diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 4b0cea91..561086f0 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -1103,9 +1103,9 @@ static int LoadWavefile(CompileContext *ctx, FILE *f, const char *fname) sr2 = Read4Bytes(f); fseek(f, 40, SEEK_SET); - if ((sr1 != samplerate_native) || (sr2 != sr1*2)) { - if (sr1 != samplerate_native) - error(ctx, "Can't resample (%d to %d): %s", sr1, samplerate_native, fname); + if ((sr1 != samplerate) || (sr2 != sr1*2)) { + if (sr1 != samplerate) + error(ctx, "Can't resample (%d to %d): %s", sr1, samplerate, fname); else error(ctx, "WAV file is not mono: %s", fname); return 0; @@ -2370,7 +2370,7 @@ espeak_ng_CompilePhonemeDataPath(long rate, sprintf(phdst, "%s", path_home); } - samplerate_native = samplerate = rate; + samplerate = rate; LoadPhData(NULL, NULL); if (LoadVoice("", 8/*compiling phonemes*/) == NULL) { clean_context(ctx); @@ -2449,7 +2449,7 @@ espeak_ng_CompilePhonemeDataPath(long rate, // write a word so that further data doesn't start at displ=0 Write4Bytes(ctx->f_phdata, version_phdata); - Write4Bytes(ctx->f_phdata, samplerate_native); + Write4Bytes(ctx->f_phdata, samplerate); Write4Bytes(ctx->f_phindex, version_phdata); memset(ctx->ref_hash_tab, 0, sizeof(ctx->ref_hash_tab)); diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index fa632110..651efa2f 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -77,7 +77,7 @@ espeak_ng_STATUS LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, mbr_name_prefix = 0; if (mbrola_voice == NULL) { - samplerate = samplerate_native; + samplerate = samplerate; SetParameter(espeakVOICETYPE, 0, 0); return ENS_OK; } diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 4d9db340..fa96b7c9 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -423,7 +423,6 @@ void MarkerEvent(int type, unsigned int char_position, int value, int value2, un extern unsigned char *wavefile_data; extern int samplerate; -extern int samplerate_native; #define N_ECHO_BUF 5500 // max of 250mS at 22050 Hz extern int echo_head; diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 150694db..aeabdc82 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -271,7 +271,7 @@ void VoiceReset(int tone_only) voice->voicing = 64; voice->consonant_amp = 90; // change from 100 to 90 for v.1.47 voice->consonant_ampv = 100; - voice->samplerate = samplerate_native; + voice->samplerate = samplerate; memset(voice->klattv, 0, sizeof(voice->klattv)); speed.fast_settings = espeakRATE_MAXIMUM; diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index 407a4acf..35b3ebf4 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -62,7 +62,6 @@ int embedded_value[N_EMBEDDED_VALUES]; static int PHASE_INC_FACTOR; int samplerate = 0; // this is set by Wavegeninit() -int samplerate_native = 0; static wavegen_peaks_t peaks[N_PEAKS]; static int peak_harmonic[N_PEAKS]; @@ -330,7 +329,7 @@ void WavegenInit(int rate, int wavemult_fact) wavemult_fact = 60; // default wvoice = NULL; - samplerate = samplerate_native = rate; + samplerate = rate; PHASE_INC_FACTOR = 0x8000000 / samplerate; // assumes pitch is Hz*32 Flutter_inc = (64 * samplerate)/rate; samplecount = 0;