diff --git a/source/SoundStretch/RunParameters.cpp b/source/SoundStretch/RunParameters.cpp index 1a4086b..2e0c0c6 100644 --- a/source/SoundStretch/RunParameters.cpp +++ b/source/SoundStretch/RunParameters.cpp @@ -88,6 +88,7 @@ static const char usage[] = " If '=n' is omitted, just detects the BPM rate.\n" " -quick : Use quicker tempo change algorithm (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"; @@ -130,6 +131,7 @@ RunParameters::RunParameters(const int nParams, const char * const paramStr[]) quick = 0; noAntiAlias = 0; goalBPM = 0; + speech = FALSE; detectBPM = FALSE; // Get input & output file names @@ -288,6 +290,11 @@ void RunParameters::parseSwitchParam(const string &str) throwLicense(); break; + case 's' : + // switch '-speech' + speech = TRUE; + break; + default: // unknown switch throwIllegalParamExp(str); diff --git a/source/SoundStretch/RunParameters.h b/source/SoundStretch/RunParameters.h index d6ea1bc..ecdb5d6 100644 --- a/source/SoundStretch/RunParameters.h +++ b/source/SoundStretch/RunParameters.h @@ -64,6 +64,7 @@ public: int noAntiAlias; float goalBPM; BOOL detectBPM; + BOOL speech; RunParameters(const int nParams, const char * const paramStr[]); }; diff --git a/source/SoundStretch/main.cpp b/source/SoundStretch/main.cpp index a1a8d23..d224cbe 100644 --- a/source/SoundStretch/main.cpp +++ b/source/SoundStretch/main.cpp @@ -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_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 if (params->outFileName) {