This works around issue 915master
| // Several phoneme tables may be loaded into memory. phoneme_tab points to | // Several phoneme tables may be loaded into memory. phoneme_tab points to | ||||
| // one for the current voice | // one for the current voice | ||||
| extern int n_phoneme_tab; | extern int n_phoneme_tab; | ||||
| extern int current_phoneme_table; | |||||
| extern PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; | extern PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; | ||||
| typedef struct { | typedef struct { |
| // copy the current phoneme table into here | // copy the current phoneme table into here | ||||
| int n_phoneme_tab; | int n_phoneme_tab; | ||||
| int current_phoneme_table; | |||||
| PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; | PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; | ||||
| unsigned short *phoneme_index = NULL; | unsigned short *phoneme_index = NULL; | ||||
| } | } | ||||
| } | } | ||||
| int SelectPhonemeTable(int number) | |||||
| void SelectPhonemeTable(int number) | |||||
| { | { | ||||
| n_phoneme_tab = 0; | n_phoneme_tab = 0; | ||||
| SetUpPhonemeTable(number); // recursively for included phoneme tables | SetUpPhonemeTable(number); // recursively for included phoneme tables | ||||
| n_phoneme_tab++; | n_phoneme_tab++; | ||||
| return number; | |||||
| current_phoneme_table = number; | |||||
| } | } | ||||
| int LookupPhonemeTable(const char *name) | int LookupPhonemeTable(const char *name) |
| PHONEME_LIST *plist); | PHONEME_LIST *plist); | ||||
| int PhonemeCode(unsigned int mnem); | int PhonemeCode(unsigned int mnem); | ||||
| int SelectPhonemeTable(int number); | |||||
| void SelectPhonemeTable(int number); | |||||
| int SelectPhonemeTableName(const char *name); | int SelectPhonemeTableName(const char *name); | ||||
| #ifdef __cplusplus | #ifdef __cplusplus |
| return 0; | return 0; | ||||
| } | } | ||||
| if (current_phoneme_table != voice->phoneme_tab_ix) | |||||
| SelectPhonemeTable(voice->phoneme_tab_ix); | |||||
| // read the next clause from the input text file, translate it, and generate | // read the next clause from the input text file, translate it, and generate | ||||
| // entries in the wavegen command queue | // entries in the wavegen command queue | ||||
| TranslateClause(translator, &clause_tone, &voice_change); | TranslateClause(translator, &clause_tone, &voice_change); |