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

// 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 {

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



// 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;
static int current_phoneme_table;
PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; PHONEME_TAB *phoneme_tab[N_PHONEME_TAB];


static unsigned short *phoneme_index = NULL; static unsigned short *phoneme_index = NULL;
phoneme_index = NULL; phoneme_index = NULL;
phondata_ptr = NULL; phondata_ptr = NULL;
tunes = NULL; tunes = NULL;
current_phoneme_table = -1;
} }


int PhonemeCode(unsigned int mnem) int PhonemeCode(unsigned int mnem)


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

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

return 0; 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 // 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

Loading…
Cancel
Save