Browse Source

cleanup: move stressAmp to LoadLanguageOptions()

master
Juho Hiltunen 2 years ago
parent
commit
46bc25e173
2 changed files with 14 additions and 16 deletions
  1. 13
    0
      src/libespeak-ng/langopts.c
  2. 1
    16
      src/libespeak-ng/voices.c

+ 13
- 0
src/libespeak-ng/langopts.c View File

@@ -110,8 +110,21 @@ void LoadLanguageOptions(Translator *translator, int key, char *keyValue ) {

break;
}
case V_STRESSAMP: {
if (CheckTranslator(translator, langopts_tab, key) != 0)
break;

int stress_amps_set = 0;
int stress_amps[8];

stress_amps_set = Read8Numbers(keyValue, stress_amps);

for (ix = 0; ix < stress_amps_set; ix++) {
translator->stress_amps[ix] = stress_amps[ix];
}

break;
}
case V_STRESSLENGTH: {
if (CheckTranslator(translator, langopts_tab, key) != 0)
break;

+ 1
- 16
src/libespeak-ng/voices.c View File

@@ -123,6 +123,7 @@ enum {
const MNEM_TAB langopts_tab[] = {
{ "lowercaseSentence", V_LOWERCASE_SENTENCE },
{ "stressAdd", V_STRESSADD },
{ "stressAmp", V_STRESSAMP },
{ "stressLength", V_STRESSLENGTH },

{ "maintainer", V_MAINTAINER },
@@ -141,7 +142,6 @@ static const MNEM_TAB keyword_tab[] = {
{ "pitch", V_PITCH },
{ "phonemes", V_PHONEMES },
{ "dictionary", V_DICTIONARY },
{ "stressAmp", V_STRESSAMP },
{ "intonation", V_INTONATION },
{ "tunes", V_TUNES },
{ "dictrules", V_DICTRULES },
@@ -715,21 +715,6 @@ voice_t *LoadVoice(const char *vname, int control)
break;


case V_STRESSAMP: { // stressAmp
if (CheckTranslator(translator, keyword_tab, key) != 0)
break;

int stress_amps_set = 0;
int stress_amps[8];
stress_amps_set = Read8Numbers(p, stress_amps);
for (ix = 0; ix < stress_amps_set; ix++) {
translator->stress_amps[ix] = stress_amps[ix];
}

break;
}


case V_INTONATION: // intonation
sscanf(p, "%d", &option_tone_flags);
if ((option_tone_flags & 0xff) != 0) {

Loading…
Cancel
Save