[1.46.46]

Fix: SAPI5 version, pitch not reset correctly after indicating capital letter.
Language changes: ga, nl, pt.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@312 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2013-03-11 21:28:06 +00:00
parent 6691b67f02
commit 8238f8b09b
42 changed files with 697 additions and 515 deletions
+25 -13
View File
@@ -47,7 +47,6 @@ static int SubstitutePhonemes(Translator *tr, PHONEME_LIST *plist_out)
int replace_flags;
int n_plist_out = 0;
int word_end;
int switched_language = 0;
PHONEME_LIST2 *plist2;
PHONEME_TAB *next=NULL;
@@ -55,11 +54,8 @@ static int SubstitutePhonemes(Translator *tr, PHONEME_LIST *plist_out)
{
plist2 = &ph_list2[ix];
if(plist2->phcode == phonSWITCH)
switched_language ^= 1;
// don't do any substitution if the language has been temporarily changed
if(switched_language == 0)
if(!(plist2->synthflags & SFLAG_SWITCHED_LANG))
{
if(ix < (n_ph_list2 -1))
next = phoneme_tab[ph_list2[ix+1].phcode];
@@ -81,6 +77,9 @@ static int SubstitutePhonemes(Translator *tr, PHONEME_LIST *plist_out)
if((replace_flags & 2) && ((plist2->stresslevel & 0x7) > 3))
continue; // this replacement doesn't occur in stressed syllables
if((replace_flags & 4) && (plist2->sourceix == 0))
continue; // this replacement only occurs at the start of a word
// substitute the replacement phoneme
plist2->phcode = replace_phonemes[k].new_ph;
if((plist2->stresslevel > 1) && (phoneme_tab[plist2->phcode]->phflags & phUNSTRESSED))
@@ -117,7 +116,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
PHONEME_TAB *next, *next2;
int unstress_count = 0;
int word_stress = 0;
int switched_language = 0;
int current_phoneme_tab;
int max_stress;
int voicing;
int regression;
@@ -166,6 +165,20 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
}
}
// look for switch of phoneme tables
current_phoneme_tab = tr->phoneme_tab_ix;
for(j = 0; j < n_ph_list2; j++)
{
if(plist2[j].phcode == phonSWITCH)
{
current_phoneme_tab = plist2[j].tone_ph;
}
if(current_phoneme_tab != tr->phoneme_tab_ix)
{
plist2[j].synthflags |= SFLAG_SWITCHED_LANG;
}
}
if((regression = tr->langopts.param[LOPT_REGRESSIVE_VOICING]) != 0)
{
// set consonant clusters to all voiced or all unvoiced
@@ -180,10 +193,12 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
if(ph == NULL)
continue;
if(ph->code == phonSWITCH)
switched_language ^= 1;
if(switched_language)
if(plist2[j].synthflags & SFLAG_SWITCHED_LANG)
{
stop_propagation = 0;
voicing = 0;
continue;
}
type = ph->type;
@@ -295,8 +310,6 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
ph = phoneme_tab[phonPAUSE];
ph_list3[0].ph = ph;
switched_language = 0;
for(j=0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++)
{
plist3 = &ph_list3[j];
@@ -333,7 +346,6 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
// change phoneme table
SelectPhonemeTable(plist3->tone_ph);
switched_language ^= SFLAG_SWITCHED_LANG;
}
next = phoneme_tab[plist3[1].phcode]; // the phoneme after this one
plist3[1].ph = next;
@@ -534,7 +546,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
phlist[ix].ph = ph;
phlist[ix].type = ph->type;
phlist[ix].env = PITCHfall; // default, can be changed in the "intonation" module
phlist[ix].synthflags = plist3->synthflags | switched_language;
phlist[ix].synthflags = plist3->synthflags;
phlist[ix].stresslevel = plist3->stresslevel & 0xf;
phlist[ix].wordstress = plist3->wordstress;
phlist[ix].tone_ph = plist3->tone_ph;