Added '-speech' parameter for SoundStretch utility

This commit is contained in:
oparviai 2009-05-17 16:48:30 +00:00
parent fb966425c4
commit 7ddf78f073
3 changed files with 17 additions and 0 deletions

View File

@ -88,6 +88,7 @@ static const char usage[] =
" If '=n' is omitted, just detects the BPM rate.\n" " If '=n' is omitted, just detects the BPM rate.\n"
" -quick : Use quicker tempo change algorithm (gain speed, lose quality)\n" " -quick : Use quicker tempo change algorithm (gain speed, lose quality)\n"
" -naa : Don't use anti-alias filtering (gain speed, lose quality)\n" " -naa : Don't use anti-alias filtering (gain speed, lose quality)\n"
" -speech : Tune algorithm for speech processing (default is for music)\n"
" -license : Display the program license text (LGPL)\n"; " -license : Display the program license text (LGPL)\n";
@ -130,6 +131,7 @@ RunParameters::RunParameters(const int nParams, const char * const paramStr[])
quick = 0; quick = 0;
noAntiAlias = 0; noAntiAlias = 0;
goalBPM = 0; goalBPM = 0;
speech = FALSE;
detectBPM = FALSE; detectBPM = FALSE;
// Get input & output file names // Get input & output file names
@ -288,6 +290,11 @@ void RunParameters::parseSwitchParam(const string &str)
throwLicense(); throwLicense();
break; break;
case 's' :
// switch '-speech'
speech = TRUE;
break;
default: default:
// unknown switch // unknown switch
throwIllegalParamExp(str); throwIllegalParamExp(str);

View File

@ -64,6 +64,7 @@ public:
int noAntiAlias; int noAntiAlias;
float goalBPM; float goalBPM;
BOOL detectBPM; BOOL detectBPM;
BOOL speech;
RunParameters(const int nParams, const char * const paramStr[]); RunParameters(const int nParams, const char * const paramStr[]);
}; };

View File

@ -134,6 +134,15 @@ static void setup(SoundTouch *pSoundTouch, const WavInFile *inFile, const RunPar
pSoundTouch->setSetting(SETTING_USE_QUICKSEEK, params->quick); pSoundTouch->setSetting(SETTING_USE_QUICKSEEK, params->quick);
pSoundTouch->setSetting(SETTING_USE_AA_FILTER, !(params->noAntiAlias)); pSoundTouch->setSetting(SETTING_USE_AA_FILTER, !(params->noAntiAlias));
if (params->speech)
{
// use settings for speech processing
pSoundTouch->setSetting(SETTING_SEQUENCE_MS, 40);
pSoundTouch->setSetting(SETTING_SEEKWINDOW_MS, 15);
pSoundTouch->setSetting(SETTING_OVERLAP_MS, 8);
fprintf(stderr, "Tune processing parameters for speech processing.\n");
}
// print processing information // print processing information
if (params->outFileName) if (params->outFileName)
{ {