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);
}
Ejemplo n.º 2
0
void SoundTouch_setTempoChange(void *stouch, float percentTempo) 
{
    SoundTouch *soundTouch = (SoundTouch *)stouch;
    soundTouch->setTempoChange(percentTempo);
}