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));
+1 -1
View File
@@ -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;
}
-1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -2
View File
@@ -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;