mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-05 22:53:38 +00:00
Revert "code cleanup: change global int current_phoneme table to static"
This works around issue 915
This commit is contained in:
committed by
Juho Hiltunen
parent
4d0a4df86b
commit
289d9d865e
@@ -249,6 +249,7 @@ phoneme_add_feature(PHONEME_TAB *phoneme,
|
||||
// Several phoneme tables may be loaded into memory. phoneme_tab points to
|
||||
// one for the current voice
|
||||
extern int n_phoneme_tab;
|
||||
extern int current_phoneme_table;
|
||||
extern PHONEME_TAB *phoneme_tab[N_PHONEME_TAB];
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -45,6 +45,7 @@ const int version_phdata = 0x014801;
|
||||
|
||||
// copy the current phoneme table into here
|
||||
int n_phoneme_tab;
|
||||
int current_phoneme_table;
|
||||
PHONEME_TAB *phoneme_tab[N_PHONEME_TAB];
|
||||
|
||||
unsigned short *phoneme_index = NULL;
|
||||
@@ -346,12 +347,12 @@ static void SetUpPhonemeTable(int number)
|
||||
}
|
||||
}
|
||||
|
||||
int SelectPhonemeTable(int number)
|
||||
void SelectPhonemeTable(int number)
|
||||
{
|
||||
n_phoneme_tab = 0;
|
||||
SetUpPhonemeTable(number); // recursively for included phoneme tables
|
||||
n_phoneme_tab++;
|
||||
return number;
|
||||
current_phoneme_table = number;
|
||||
}
|
||||
|
||||
int LookupPhonemeTable(const char *name)
|
||||
|
||||
@@ -53,7 +53,7 @@ frameref_t *LookupSpect(PHONEME_TAB *this_ph,
|
||||
PHONEME_LIST *plist);
|
||||
|
||||
int PhonemeCode(unsigned int mnem);
|
||||
int SelectPhonemeTable(int number);
|
||||
void SelectPhonemeTable(int number);
|
||||
int SelectPhonemeTableName(const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1561,6 +1561,9 @@ int SpeakNextClause(int control)
|
||||
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
|
||||
// entries in the wavegen command queue
|
||||
TranslateClause(translator, &clause_tone, &voice_change);
|
||||
|
||||
Reference in New Issue
Block a user