diff --git a/src/Makefile b/src/Makefile index a125453a..3f3709cb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ INCDIR=/usr/include/espeak LIBDIR=/usr/lib DATADIR=/usr/share/espeak-data -RELEASE = 1.24 +RELEASE = 1.29 BIN_NAME = speak BIN2_NAME = espeak LIB_NAME = libespeak.so diff --git a/src/phonemelist.cpp b/src/phonemelist.cpp index a8975004..daaff7c4 100755 --- a/src/phonemelist.cpp +++ b/src/phonemelist.cpp @@ -187,6 +187,7 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) int regression; int end_sourceix; int alternative; + int first_vowel=0; // first vowel in a word PHONEME_LIST2 ph_list3[N_PHONEME_LIST]; static PHONEME_LIST2 ph_list2_null = {0,0,0,0,0}; @@ -210,12 +211,12 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) // the last word is unstressed, look for a previous word that can be stressed while(--j >= 0) { - if(ph_list2[j].stress & 0x80) // dictionary flags indicated that this stress can be promoted + if(ph_list2[j].synthflags & SFLAG_PROMOTE_STRESS) // dictionary flags indicated that this stress can be promoted { ph_list2[j].stress = 4; // promote to stressed break; } - if((ph_list2[j].stress & 0x7f) >= 4) + if(ph_list2[j].stress >= 4) { // found a stressed syllable, so stop looking break; @@ -338,6 +339,7 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) // start of a word int k; word_stress = 0; + first_vowel = 1; // find the highest stress level in this word for(k=j+1; k < n_ph_list2; k++) @@ -456,6 +458,9 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) break; } + if((stress_level == 1) && (first_vowel)) + stress_level = 0; // ignore 'dimished' stress on first syllable + if(stress_level == 1) reduce = 1; // stress = 'reduced' @@ -474,6 +479,9 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) break; } + if(ph->type == phVOWEL) + first_vowel = 0; + if((plist2+1)->synthflags & SFLAG_LENGTHEN) { static char types_double[] = {phFRICATIVE,phVFRICATIVE,phNASAL,phLIQUID,0}; @@ -520,23 +528,6 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence) next2 = phoneme_tab[(plist2+2)->phcode]; -#ifdef deleted - if((ph->type != phVOWEL) && (ph->type != phPAUSE) //&& ((ph->phflags & phVOICED)==0) - && (next->type == phLIQUID) && (next->mnemonic != ';') && (next2->type != phVOWEL)) - { - // semi-vowel surrounded by consonants. precede by a short schwa - insert_ph = phonSCHWA_SHORT; - insert_synthflags = SFLAG_SYLLABLE; - } - - if((ph->type == phLIQUID) && (prev->type != phVOWEL) && (next->type != phVOWEL)) - { - // semi-vowel surrounded by consonants. precede by a short schwa - insert_ph = phonSCHWA_SHORT; - insert_synthflags = SFLAG_SYLLABLE; - } -#endif - if((insert_ph == 0) && (ph->link_out != 0) && (((plist2+1)->synthflags & SFLAG_EMBEDDED)==0)) { if(ph->phflags & phAPPENDPH) diff --git a/src/synthesize.h b/src/synthesize.h index ca15d442..10fd38b0 100755 --- a/src/synthesize.h +++ b/src/synthesize.h @@ -43,7 +43,7 @@ #define SFLAG_LENGTHEN 0x08 // lengthen symbol : included after this phoneme #define SFLAG_DICTIONARY 0x10 // the pronunciation of this word was listed in the xx_list dictionary #define SFLAG_SWITCHED_LANG 0x20 // this word uses phonemes from a different language - +#define SFLAG_PROMOTE_STRESS 0x40 // this unstressed word can be promoted to stressed // embedded command numbers #define EMBED_P 1 // pitch diff --git a/src/translate.cpp b/src/translate.cpp index aeb4b473..b1bbd643 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -1494,7 +1494,7 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne if(flags & FLAG_STRESS_END2) { // this's word's stress could be increased later - ph_list2[max_stress_ix].stress |= 0x80; + ph_list2[max_stress_ix].synthflags |= SFLAG_PROMOTE_STRESS; } prev_dict_flags = flags; diff --git a/src/wavegen.cpp b/src/wavegen.cpp index d7426a5e..308abe88 100755 --- a/src/wavegen.cpp +++ b/src/wavegen.cpp @@ -1341,7 +1341,7 @@ static int Wavegen() z2 = (z2 * mix_wave_amp)/32; } - z1 = z2 + (((total>>7) * amplitude2) >> 14); + z1 = z2 + (((total>>8) * amplitude2) >> 13); echo = (echo_buf[echo_tail++] * echo_amp); z1 += echo >> 8;