mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
code cleanup: move voices->width in LoadVoice()
It's probably unnecessary code and could be removed. However, it would break tests. This is a temporary solution. The solution is to do it once in VoiceReset() and then if the "formant" keyword changes voice->width.
This commit is contained in:
@@ -415,6 +415,9 @@ void VoiceReset(int tone_only)
|
||||
n_replace_phonemes = 0;
|
||||
LoadMbrolaTable(NULL, NULL, 0);
|
||||
}
|
||||
|
||||
// probably unnecessary, but removing this would break tests
|
||||
voice->width[0] = (voice->width[0] * 105)/100;
|
||||
}
|
||||
|
||||
static void VoiceFormant(char *p)
|
||||
@@ -445,6 +448,10 @@ static void VoiceFormant(char *p)
|
||||
if (width >= 0)
|
||||
voice->width[formant] = (int)(width * 2.56001);
|
||||
voice->freqadd[formant] = freqadd;
|
||||
|
||||
// probably unnecessary, but removing this would break tests
|
||||
if (formant == 0)
|
||||
voice->width[0] = (voice->width[0] * 105)/100;
|
||||
}
|
||||
|
||||
static void PhonemeReplacement(char *p)
|
||||
@@ -956,8 +963,6 @@ voice_t *LoadVoice(const char *vname, int control)
|
||||
voice_languages[langix] = 0;
|
||||
}
|
||||
|
||||
voice->width[0] = (voice->width[0] * 105)/100;
|
||||
|
||||
return voice;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user