|
|
@@ -43,7 +43,10 @@ const unsigned char pause_phonemes[8] = { |
|
|
|
0, phonPAUSE_VSHORT, phonPAUSE_SHORT, phonPAUSE, phonPAUSE_LONG, phonGLOTTALSTOP, phonPAUSE_LONG, phonPAUSE_LONG |
|
|
|
}; |
|
|
|
|
|
|
|
static int SubstitutePhonemes(PHONEME_LIST *plist_out, int n_ph_list2, PHONEME_LIST2 *ph_list2) |
|
|
|
extern int n_ph_list2; |
|
|
|
extern PHONEME_LIST2 ph_list2[N_PHONEME_LIST]; // first stage of text->phonemes |
|
|
|
|
|
|
|
static int SubstitutePhonemes(PHONEME_LIST *plist_out) |
|
|
|
{ |
|
|
|
// Copy the phonemes list and perform any substitutions that are required for the |
|
|
|
// current voice |
|
|
@@ -109,7 +112,7 @@ static int SubstitutePhonemes(PHONEME_LIST *plist_out, int n_ph_list2, PHONEME_L |
|
|
|
return n_plist_out; |
|
|
|
} |
|
|
|
|
|
|
|
void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n_ph_list2, PHONEME_LIST2 *ph_list2) |
|
|
|
void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence) |
|
|
|
{ |
|
|
|
int ix = 0; |
|
|
|
int j; |
|
|
@@ -143,11 +146,11 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n |
|
|
|
memset(&worddata, 0, sizeof(worddata)); |
|
|
|
plist2 = ph_list2; |
|
|
|
phlist = phoneme_list; |
|
|
|
end_sourceix = plist2[*n_ph_list2 - 1].sourceix; |
|
|
|
end_sourceix = plist2[n_ph_list2-1].sourceix; |
|
|
|
|
|
|
|
// is the last word of the clause unstressed ? |
|
|
|
max_stress = 0; |
|
|
|
for (j = *n_ph_list2 - 3; j >= 0; j--) { |
|
|
|
for (j = n_ph_list2-3; j >= 0; j--) { |
|
|
|
// start with the last phoneme (before the terminating pauses) and move backwards |
|
|
|
if ((plist2[j].stresslevel & 0x7f) > max_stress) |
|
|
|
max_stress = plist2[j].stresslevel & 0x7f; |
|
|
@@ -172,7 +175,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n |
|
|
|
delete_count = 0; |
|
|
|
current_phoneme_tab = tr->phoneme_tab_ix; |
|
|
|
int deleted_sourceix = -1; |
|
|
|
for (j = 0; j < *n_ph_list2; j++) { |
|
|
|
for (j = 0; j < n_ph_list2; j++) { |
|
|
|
if (current_phoneme_tab != tr->phoneme_tab_ix) |
|
|
|
plist2[j].synthflags |= SFLAG_SWITCHED_LANG; |
|
|
|
|
|
|
@@ -200,7 +203,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
*n_ph_list2 -= delete_count; |
|
|
|
n_ph_list2 -= delete_count; |
|
|
|
|
|
|
|
if ((regression = tr->langopts.param[LOPT_REGRESSIVE_VOICING]) != 0) { |
|
|
|
// set consonant clusters to all voiced or all unvoiced |
|
|
@@ -209,7 +212,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n |
|
|
|
bool stop_propagation = false; |
|
|
|
voicing = 0; |
|
|
|
|
|
|
|
for (j = *n_ph_list2 - 1; j >= 0; j--) { |
|
|
|
for (j = n_ph_list2-1; j >= 0; j--) { |
|
|
|
ph = phoneme_tab[plist2[j].phcode]; |
|
|
|
if (ph == NULL) |
|
|
|
continue; |
|
|
@@ -270,7 +273,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
n_ph_list3 = SubstitutePhonemes(ph_list3, (int) *n_ph_list2, ph_list2) - 2; |
|
|
|
n_ph_list3 = SubstitutePhonemes(ph_list3) - 2; |
|
|
|
|
|
|
|
for (j = 0; (j < n_ph_list3) && (ix < N_PHONEME_LIST-3);) { |
|
|
|
if (ph_list3[j].sourceix) { |