当前位置: 首页>>代码示例>>C++>>正文


C++ SoundTouch类代码示例

本文整理汇总了C++中SoundTouch的典型用法代码示例。如果您正苦于以下问题:C++ SoundTouch类的具体用法?C++ SoundTouch怎么用?C++ SoundTouch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SoundTouch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SoundTouch

void *SoundTouch_init(void) 
{
    SoundTouch *soundTouch = new SoundTouch();
    soundTouch->setSetting(SETTING_USE_QUICKSEEK, false);
    soundTouch->setSetting(SETTING_USE_AA_FILTER, true);
    return (void *)soundTouch;
}
开发者ID:ADTSH,项目名称:io,代码行数:7,代码来源:SoundTouch_wrapper.cpp

示例2: AVSStereoSoundTouch

AVSStereoSoundTouch(PClip _child, float _tempo, float _rate, float _pitch, const AVSValue* args, IScriptEnvironment* env)
: GenericVideoFilter(_child), 
  tempo(_tempo/100.0f), rate(_rate/100.0f), pitch(_pitch/100.0f)
{
//  last_nch = vi.AudioChannels();
  
  dstbuffer = new SFLOAT[BUFFERSIZE * vi.AudioChannels()];

  sample_multiplier  = tempo / pitch;  // Do it the same way the library does it!
  sample_multiplier *= pitch * rate;

  sampler = new SoundTouch();

  sampler->setRate(rate);
  sampler->setTempo(tempo);
  sampler->setPitch(pitch);
  sampler->setChannels(2);
  sampler->setSampleRate(vi.audio_samples_per_second);
  AVSsoundtouch::setSettings(sampler, args, env);

  vi.num_audio_samples = (__int64)((long double)vi.num_audio_samples / sample_multiplier);

  next_sample = 0;  // Next output sample
  inputReadOffset = 0;  // Next input sample
  dst_samples_filled = 0;

}
开发者ID:1974kpkpkp,项目名称:AviSynthPlus,代码行数:27,代码来源:TimeStretch.cpp

示例3: SoundTouch

void *vc_soundtouch_create(int rate, float pitch)
{
    SoundTouch *st;
    st = new SoundTouch();
    if (st) {
        st->setChannels(1);
        st->setSampleRate(rate);
        st->setPitchSemiTones(pitch);
        st->setSetting(SETTING_USE_QUICKSEEK, 1);
        st->setSetting(SETTING_USE_AA_FILTER, 1);
    }
    return st;
}
开发者ID:cmendes0101,项目名称:asterisk-parrot,代码行数:13,代码来源:voicechanger.cpp

示例4: vc_voice_change

void vc_voice_change(void *st_, float *fbuf, int16_t *data,
                     int samples, int datalen)
{
    SoundTouch *st = (SoundTouch *)st_;

#if defined(INTEGER_SAMPLES) || defined(SOUNDTOUCH_INTEGER_SAMPLES)

    st->putSamples(data, samples);
    if (st->numSamples() >= samples) {
        st->receiveSamplesEx(data, samples);
    } else {
        memset(data, 0, datalen);
    }

#elif defined(FLOAT_SAMPLES) || defined(SOUNDTOUCH_FLOAT_SAMPLES)

    slin_to_flin(fbuf, data, samples);
    st->putSamples(fbuf, samples);
    if ((int)st->numSamples() >= samples) {
        st->receiveSamples(fbuf, samples);
        flin_to_slin(data, fbuf, samples);
    } else {
        memset(data, 0, datalen);
    }

#else
#  error "unknown soundtouch sample type"
#endif
}
开发者ID:cmendes0101,项目名称:asterisk-parrot,代码行数:29,代码来源:voicechanger.cpp

示例5: SoundTouch_receiveSamples

unsigned int SoundTouch_receiveSamples(void *stouch, float *samples, unsigned int maxSamples) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    return soundTouch->receiveSamples(samples, maxSamples);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例6: Java_net_surina_soundtouch_SoundTouch_setTempo

extern "C" DLL_PUBLIC void Java_net_surina_soundtouch_SoundTouch_setTempo(JNIEnv *env, jobject thiz, jlong handle, jfloat tempo)
{
	SoundTouch *ptr = (SoundTouch*)handle;
	ptr->setTempo(tempo);
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:5,代码来源:soundtouch-jni.cpp

示例7: SoundTouch_setTempo

void SoundTouch_setTempo(void *stouch, float tempo) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setTempo(tempo);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例8: SoundTouch_setTempoChange

void SoundTouch_setTempoChange(void *stouch, float percentTempo) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setTempoChange(percentTempo);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例9: SoundTouch_setChannels

void SoundTouch_setChannels(void *stouch, unsigned int channels) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setChannels(channels);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例10: SoundTouch_setSampleRate

void SoundTouch_setSampleRate(void *stouch, unsigned int sampleRate) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setSampleRate(sampleRate); 
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例11: Java_net_surina_soundtouch_SoundTouch_setSpeed

extern "C" DLL_PUBLIC void Java_net_surina_soundtouch_SoundTouch_setSpeed(JNIEnv *env, jobject thiz, jlong handle, jfloat speed)
{
	SoundTouch *ptr = (SoundTouch*)handle;
	ptr->setRate(speed);
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:5,代码来源:soundtouch-jni.cpp

示例12: Java_net_surina_soundtouch_SoundTouch_setPitchSemiTones

extern "C" DLL_PUBLIC void Java_net_surina_soundtouch_SoundTouch_setPitchSemiTones(JNIEnv *env, jobject thiz, jlong handle, jfloat pitch)
{
	SoundTouch *ptr = (SoundTouch*)handle;
	ptr->setPitchSemiTones(pitch);
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:5,代码来源:soundtouch-jni.cpp

示例13: SoundTouch_setPitchSemiTones

void SoundTouch_setPitchSemiTones(void *stouch, float semiTones) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setPitchSemiTones(semiTones);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例14: SoundTouch_putSamples

void SoundTouch_putSamples(void *stouch, float *samples, unsigned int numSamples) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->putSamples(samples, numSamples);
}
开发者ID:ADTSH,项目名称:io,代码行数:5,代码来源:SoundTouch_wrapper.cpp

示例15: ChangePcmTone

static void ChangePcmTone(FILE *inFile, FILE *outFile, float TempoChange, float PitchSemiTones, float RateChange)
{
	SoundTouch soundTouch;

	// Setup the 'SoundTouch' object for processing the sound

	soundTouch.setSampleRate(8000);
	soundTouch.setChannels(1);

	soundTouch.setTempoChange(TempoChange);
	soundTouch.setPitchSemiTones(PitchSemiTones); //’˝œÚ «x÷·¿≠≥§£¨4±»Ωœ¿ÌœÎ
	soundTouch.setRateChange(RateChange);     //’˝œÚ «x÷·¿≠≥§£¨50

	//soundTouch.setTempoChange(20);
	//soundTouch.setPitchSemiTones(6.0f); //’˝œÚ «x÷·¿≠≥§£¨4±»Ωœ¿ÌœÎ
	//soundTouch.setRateChange(0);     //’˝œÚ «x÷·¿≠≥§£¨50

	//soundTouch.setTempoChange(1.0);
	//soundTouch.setPitchSemiTones(20);
	//soundTouch.setRateChange(-2.0);

	soundTouch.setSetting(SETTING_USE_QUICKSEEK, 0);
	soundTouch.setSetting(SETTING_USE_AA_FILTER, 1);
	soundTouch.setSetting(SETTING_SEQUENCE_MS, 40);
	soundTouch.setSetting(SETTING_SEEKWINDOW_MS, 15);
	soundTouch.setSetting(SETTING_OVERLAP_MS, 8);

#if 0
	if (params->speech)
	{
		// use settings for speech processing
		soundTouch.setSetting(SETTING_SEQUENCE_MS, 40);
		soundTouch.setSetting(SETTING_SEEKWINDOW_MS, 15);
		soundTouch.setSetting(SETTING_OVERLAP_MS, 8);
		fprintf(stderr, "Tune processing parameters for speech processing.\n");
	}
#endif
	// Process the sound
	process(&soundTouch, inFile, outFile);	
	fflush(outFile);
}
开发者ID:SchoolHome,项目名称:ShouXinerTeacher,代码行数:41,代码来源:convertPcmToAmr.cpp


注:本文中的SoundTouch类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。