Browse Source

code cleanup: static current_phoneme_table

master
Yury Popov 2 years ago
parent
commit
f5ead44481
No account linked to committer's email address
3 changed files with 4 additions and 4 deletions
  1. 0
    1
      src/libespeak-ng/phoneme.h
  2. 3
    1
      src/libespeak-ng/synthdata.c
  3. 1
    2
      src/libespeak-ng/synthesize.c

+ 0
- 1
src/libespeak-ng/phoneme.h View File

@@ -249,7 +249,6 @@ 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 {

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

@@ -49,7 +49,7 @@ const int version_phdata = 0x014801;

// copy the current phoneme table into here
int n_phoneme_tab;
int current_phoneme_table;
static int current_phoneme_table;
PHONEME_TAB *phoneme_tab[N_PHONEME_TAB];

static unsigned short *phoneme_index = NULL;
@@ -164,6 +164,7 @@ void FreePhData(void)
phoneme_index = NULL;
phondata_ptr = NULL;
tunes = NULL;
current_phoneme_table = -1;
}

int PhonemeCode(unsigned int mnem)
@@ -353,6 +354,7 @@ static void SetUpPhonemeTable(int number)

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

+ 1
- 2
src/libespeak-ng/synthesize.c View File

@@ -1549,8 +1549,7 @@ int SpeakNextClause(int control)
return 0;
}

if (current_phoneme_table != voice->phoneme_tab_ix)
SelectPhonemeTable(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

Loading…
Cancel
Save