Browse Source

code cleanup: move voice->freq2 and voice->height2 handline in LoadVoice().

VoiceReset() now sets them initially. VoiceFormant() changes them if
"formant" option is used.
master
Juho Hiltunen 4 years ago
parent
commit
72434616b0
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      src/libespeak-ng/voices.c

+ 8
- 7
src/libespeak-ng/voices.c View File

InitBreath(); InitBreath();
for (pk = 0; pk < N_PEAKS; pk++) { for (pk = 0; pk < N_PEAKS; pk++) {
voice->freq[pk] = 256; voice->freq[pk] = 256;
voice->freq2[pk] = voice->freq[pk];
voice->height[pk] = default_heights[pk]*2; voice->height[pk] = default_heights[pk]*2;
voice->height2[pk] = voice->height[pk];
voice->width[pk] = default_widths[pk]*2; voice->width[pk] = default_widths[pk]*2;
voice->breath[pk] = 0; voice->breath[pk] = 0;
voice->breathw[pk] = breath_widths[pk]; // default breath formant widths voice->breathw[pk] = breath_widths[pk]; // default breath formant widths
if ((formant < 0) || (formant > 8)) if ((formant < 0) || (formant > 8))
return; return;


if (freq >= 0)
if (freq >= 0) {
voice->freq[formant] = (int)(freq * 2.56001); voice->freq[formant] = (int)(freq * 2.56001);
if (height >= 0)
voice->freq2[formant] = voice->freq[formant];
}
if (height >= 0) {
voice->height[formant] = (int)(height * 2.56001); voice->height[formant] = (int)(height * 2.56001);
voice->height2[formant] = voice->height[formant];
}
if (width >= 0) if (width >= 0)
voice->width[formant] = (int)(width * 2.56001); voice->width[formant] = (int)(width * 2.56001);
voice->freqadd[formant] = freqadd; voice->freqadd[formant] = freqadd;


SetSpeed(3); // for speed_percent SetSpeed(3); // for speed_percent


for (ix = 0; ix < N_PEAKS; ix++) {
voice->freq2[ix] = voice->freq[ix];
voice->height2[ix] = voice->height[ix];
}

if (!tone_only) { if (!tone_only) {
if (!!(control & 8/*compiling phonemes*/)) { if (!!(control & 8/*compiling phonemes*/)) {
/* Set by espeak_ng_CompilePhonemeDataPath when it /* Set by espeak_ng_CompilePhonemeDataPath when it

Loading…
Cancel
Save