code clanup: remove unused samplerate_native

This commit is contained in:
Yury Popov
2022-11-19 17:29:16 +03:00
parent 3de7c4cdb1
commit 5a37bc301b
5 changed files with 8 additions and 10 deletions
+5 -5
View File
@@ -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));