Browse Source

Merge pull request #1158

master
Valdis Vitolins 3 years ago
parent
commit
abd8ff5f71
2 changed files with 20 additions and 1 deletions
  1. 16
    0
      src/libespeak-ng/phonemelist.c
  2. 4
    1
      src/libespeak-ng/synthdata.c

+ 16
- 0
src/libespeak-ng/phonemelist.c View File

deleted_sourceix = -1; deleted_sourceix = -1;
} }


if (plist2->phcode == phonSWITCH)
SelectPhonemeTable(plist2->tone_ph);

// don't do any substitution if the language has been temporarily changed // don't do any substitution if the language has been temporarily changed
if (!(plist2->synthflags & SFLAG_SWITCHED_LANG)) { if (!(plist2->synthflags & SFLAG_SWITCHED_LANG)) {
if (ix < (n_ph_list2 -1)) if (ix < (n_ph_list2 -1))
} }
n_ph_list2 -= delete_count; n_ph_list2 -= delete_count;


SelectPhonemeTable(current_phoneme_tab);

if ((regression = tr->langopts.param[LOPT_REGRESSIVE_VOICING]) != 0) { if ((regression = tr->langopts.param[LOPT_REGRESSIVE_VOICING]) != 0) {
// set consonant clusters to all voiced or all unvoiced // set consonant clusters to all voiced or all unvoiced
// Regressive // Regressive
voicing = 0; voicing = 0;


for (j = n_ph_list2-1; j >= 0; j--) { for (j = n_ph_list2-1; j >= 0; j--) {
if (plist2[j].phcode == phonSWITCH) {
/* Find previous phonSWITCH to determine language we're switching back to */
int k;
for (k = j-1; k >= 0; k--)
if (plist2[k].phcode == phonSWITCH)
break;
if (k >= 0)
SelectPhonemeTable(plist2[k].tone_ph);
else
SelectPhonemeTable(tr->phoneme_tab_ix);
}
ph = phoneme_tab[plist2[j].phcode]; ph = phoneme_tab[plist2[j].phcode];
if (ph == NULL) if (ph == NULL)
continue; continue;

+ 4
- 1
src/libespeak-ng/synthdata.c View File

for (ix = 0; ix < phoneme_tab_list[number].n_phonemes; ix++) { for (ix = 0; ix < phoneme_tab_list[number].n_phonemes; ix++) {
ph_code = phtab[ix].code; ph_code = phtab[ix].code;
phoneme_tab[ph_code] = &phtab[ix]; phoneme_tab[ph_code] = &phtab[ix];
if (ph_code > n_phoneme_tab) if (ph_code > n_phoneme_tab) {
memset(&phoneme_tab[n_phoneme_tab+1], 0, (ph_code - (n_phoneme_tab+1)) * sizeof(*phoneme_tab));
n_phoneme_tab = ph_code; n_phoneme_tab = ph_code;
}
} }
} }


void SelectPhonemeTable(int number) void SelectPhonemeTable(int number)
{ {
n_phoneme_tab = 0; n_phoneme_tab = 0;
MAKE_MEM_UNDEFINED(&phoneme_tab, sizeof(phoneme_tab));
SetUpPhonemeTable(number); // recursively for included phoneme tables SetUpPhonemeTable(number); // recursively for included phoneme tables
n_phoneme_tab++; n_phoneme_tab++;
current_phoneme_table = number; current_phoneme_table = number;

Loading…
Cancel
Save