diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index b3239c04..3e21d279 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -346,6 +346,12 @@ x z Z Dictionary zh_dict +@r a A ai E ei i i0 +i[ iou u + +c; j k kh l n N p +ph R R2 R3 s tc; tc; th +ts ts. ts. tsh w Dictionary zhh_dict diff --git a/espeak-data/voices/en/en-r b/espeak-data/voices/en/en-r index 4b0eaa0a..f3395a19 100755 --- a/espeak-data/voices/en/en-r +++ b/espeak-data/voices/en/en-r @@ -8,7 +8,10 @@ phonemes en_us dictrules 3 6 option 12 1 // reduce [t] -stressLength 150 125 180 180 0 0 270 300 +stressLength 150 125 180 180 0 0 270 280 stressAmp 17 16 20 20 20 22 23 20 +//replace 03 I i +//replace 03 I2 i + formant 1 99 100 100 diff --git a/phsource/compile_report b/phsource/compile_report index 9e6c4a19..385b5a05 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -272,7 +272,6 @@ l/L2_oL [(o)] base l/L2_uL [(u)] base [u:] en [u:] en_n - [u:] en_us [u:] en_rp l/l_3 [l/] de [l] fr @@ -847,8 +846,7 @@ vdiph/eei [EI] base2 [EI] de [EI] nl [EI] vi -vdiph/eei_2 [eI] en_us - [eI] eo +vdiph/eei_2 [eI] eo [ei] fi vdiph/eei_3 [eI] en_rp [eI] sk @@ -900,7 +898,6 @@ vdiph/oi [oI] base2 vdiph/oi_2 [oI] af vdiph/ooi [OI] en [OI] en_n - [OI] en_us [OI] cy [OY] cy [OI] eo @@ -908,7 +905,8 @@ vdiph/ooi [OI] en [OI] no [oi] zhy vdiph/ooi_2 [OI] af -vdiph/ooi_3 [OI] en_rp +vdiph/ooi_3 [OI] en_us + [OI] en_rp [aI] en_wm vdiph/oou [oU] cs [OU] grc @@ -1050,9 +1048,6 @@ vowel/@ [@] base [@] en [@2] en [@5] en - [@] en_us - [@2] en_us - [@5] en_us [3] en_rp [@] en_rp [V] cy @@ -1081,9 +1076,7 @@ vowel/0_3 [O:] en_us [A] hu vowel/@_2 [@] fr [W] fr -vowel/&_2 [a] en_us - [aa] en_us - [&?] zhh +vowel/&_2 [&?] zhh vowel/@_3 [@] en_sc [I] en_sc [@2] en_sc @@ -1234,7 +1227,6 @@ vowel/ee_1 [E] base2 [E:] no [e] zhy vowel/ee_2 [E] en - [E] en_us [E] cy [E2] nl [E] zh @@ -1271,7 +1263,10 @@ vowel/e_mid2 [E] af vowel/@_fnt [@2] hr [@] en_wi [@2] en_wi -vowel/@_hgh [@] no +vowel/@_hgh [@] en_us + [@2] en_us + [@5] en_us + [@] no vowel/i [i] base2 [i:] en_n [i] en_wm @@ -1292,7 +1287,8 @@ vowel/i [i] base2 [i?] zhh [i] sw [i] en_wi -vowel/i# [i] en_rp +vowel/i# [i] en_us + [i] en_rp [y:] cy vowel/i_2 [i:] en_rp [i2] de @@ -1464,12 +1460,12 @@ vowel/u_2 [u1] fi [U] hr [u] ro vowel/u#_2 [u-] sv -vowel/u_3 [u:] en_us - [yU] ro +vowel/u_3 [yU] ro vowel/u_4 [u:] en_n vowel/u#_4 [U] en_sc [u:] en_sc vowel/u_5 [u] sw +vowel/u#_5 [u:] en_us vowel/u_6 [U] pt_pt [u] pt_pt vowel/u_7 [u] vi @@ -1509,9 +1505,9 @@ vowel/uu_bck [U] en_n [U] no [u] zhy [U] en_wi -vowel/V [3] en_sc +vowel/V [V] en_us + [3] en_sc vowel/V_2 [V] en - [V] en_us [a] af [V] ru [V#] ru @@ -1594,15 +1590,17 @@ vwl_en_rp/oo [U@] en_rp vwl_en/u [u:] en vwl_en/u_L [u:] en [u:] en_n - [u:] en_us [u:] en_rp vwl_en_us/3_us [3] en_us [3:] en_us +vwl_en_us/a [a] en_us + [aa] en_us vwl_en_us/aai [aI] en_us vwl_en_us/ar [A:] en_us [A@] en_us +vwl_en_us/ee [E] en_us +vwl_en_us/ei [eI] en_us vwl_en_us/er [e@] en_us -vwl_en_us/i_final3 [i] en_us vwl_en_us/ii [I] en_us [I2] en_us vwl_en_us/ir [i@] en_us diff --git a/phsource/ph_english_us b/phsource/ph_english_us index 2286b36f..9f069286 100644 --- a/phsource/ph_english_us +++ b/phsource/ph_english_us @@ -7,7 +7,7 @@ phoneme @ // Schwa vowel starttype (@) endtype (@) - formants vowel/@ + formants vowel/@_hgh unstressed linkout r- length 130 @@ -21,13 +21,13 @@ phoneme 3 // Schwa, used for rhotic schwa in American unstressed linkout r- beforevowel @ - length 180 + length 200 endphoneme phoneme @2 // Schwa, changes to I before a vowel vowel starttype (@) endtype (@) - formants vowel/@ + formants vowel/@_hgh unstressed beforevowel I2 length 120 @@ -35,7 +35,7 @@ endphoneme phoneme @5 // Schwa, changes to U before a vowel vowel starttype (@) endtype (@) - formants vowel/@ + formants vowel/@_hgh unstressed beforevowelpause U length 130 @@ -53,18 +53,18 @@ endphoneme phoneme a vowel starttype (a) endtype (@) - length 180 - formants vowel/&_2 -// formants vwl_en_us/a + length 200 +// formants vowel/&_2 + formants vwl_en_us/a reduceto a2 0 endphoneme phoneme aa // 'bath' etc. vowel starttype (a) endtype (@) - length 190 - formants vowel/&_2 -// formants vwl_en_us/a + length 220 +// formants vowel/&_2 + formants vwl_en_us/a linkout r- endphoneme @@ -72,7 +72,7 @@ endphoneme phoneme a2 vowel starttype (@) endtype (@) unstressed - length 140 + length 150 formants vowel/a#_3 linkout r- endphoneme @@ -80,15 +80,16 @@ endphoneme phoneme E vowel starttype (e) endtype (e) - length 160 - formants vowel/ee_2 + length 185 +// formants vowel/ee_2 + formants vwl_en_us/ee reduceto I 0 endphoneme phoneme I vowel starttype (i) endtype (i) - length 130 + length 120 formants vwl_en_us/ii linkout ; endphoneme @@ -105,15 +106,16 @@ endphoneme phoneme i // optional variant of [I] for end of words vowel starttype (i) endtype (i) - length 170 - formants vwl_en_us/i_final3 + length 200 +// formants vwl_en_us/i_final3 + formants vowel/i# linkout ; endphoneme phoneme 0 vowel starttype (o) endtype (o) - length 180 + length 200 formants vowel/aa_8 reduceto @ 0 endphoneme @@ -121,9 +123,9 @@ endphoneme phoneme V vowel starttype (a) endtype (@) - length 170 -// formants vwl_en_us/V - formants vowel/V_2 + length 165 +// formants vowel/V_2 + formants vowel/V reduceto @ 0 endphoneme @@ -154,7 +156,7 @@ endphoneme phoneme 3: vowel starttype (@) endtype (@) - length 220 + length 190 // formants vwl_en_us/@r_us2 formants vwl_en_us/3_us // reduceto @ 0 @@ -164,7 +166,7 @@ endphoneme phoneme i: vowel starttype (i) endtype (i) - length 160 + length 150 formants vowel/i_en after w w/wi2 linkout ; @@ -182,7 +184,7 @@ endphoneme phoneme O@ vowel starttype (o) endtype (@) - length 240 + length 270 formants vwl_en_us/oor appendph r endphoneme @@ -190,7 +192,7 @@ endphoneme phoneme o@ vowel starttype (o) endtype (@) - length 240 + length 270 formants vwl_en_us/or appendph r endphoneme @@ -198,7 +200,7 @@ endphoneme phoneme O vowel starttype (o) endtype (o) - length 150 + length 200 formants vwl_en_us/oo reduceto @ 0 endphoneme @@ -206,50 +208,51 @@ endphoneme phoneme u: vowel starttype (u) endtype (u) - length 170 - formants vowel/u_3 - before l/2 vwl_en/u_L-40+l/L2_uL + length 160 + formants vowel/u#_5 +// before l/2 vwl_en/u_L-40+l/L2_uL endphoneme phoneme aU vowel starttype (a) endtype (u) - length 200 + length 210 formants vdiph/au_2 endphoneme phoneme oU vowel starttype (@) endtype (u) - length 210 + length 240 formants vdiph/8u endphoneme phoneme aI vowel starttype (a) endtype (i) - length 210 + length 235 formants vwl_en_us/aai endphoneme phoneme eI vowel starttype (e) endtype (i) - length 210 - formants vdiph/eei_2 + length 235 +// formants vdiph/eei_2 + formants vwl_en_us/ei endphoneme phoneme OI vowel starttype (o) endtype (i) - length 220 - formants vdiph/ooi + length 300 + formants vdiph/ooi_3 endphoneme phoneme e@ vowel starttype (e) endtype (@) - length 250 + length 280 formants vwl_en_us/er appendph r endphoneme @@ -257,7 +260,7 @@ endphoneme phoneme i@ vowel starttype (i) endtype (@) - length 220 + length 230 formants vwl_en_us/ir appendph r endphoneme @@ -265,7 +268,7 @@ endphoneme phoneme U@ vowel starttype (@) endtype (@) - length 220 + length 230 formants vwl_en_us/ur linkout r- endphoneme @@ -304,7 +307,7 @@ phoneme t# // reduced [t] as in "city" vowelin f1=0 f2=1700 -300 300 f3=-100 80 vowelout f1=0 f2=1700 -300 300 f3=-100 80 lengthmod 5 - wave x/d%80 + wave x/d%70 endphoneme diff --git a/phsource/vowel/V b/phsource/vowel/V index f902e9fc..e5dde074 100644 Binary files a/phsource/vowel/V and b/phsource/vowel/V differ diff --git a/phsource/vowel/ee#_2 b/phsource/vowel/ee#_2 index bef3ad7b..de6767cc 100644 Binary files a/phsource/vowel/ee#_2 and b/phsource/vowel/ee#_2 differ diff --git a/phsource/vowel/i# b/phsource/vowel/i# index 255c6d18..e871d029 100644 Binary files a/phsource/vowel/i# and b/phsource/vowel/i# differ diff --git a/phsource/vowel/u#_5 b/phsource/vowel/u#_5 new file mode 100644 index 00000000..ef3827ee Binary files /dev/null and b/phsource/vowel/u#_5 differ diff --git a/phsource/vowel/vowelchart.png b/phsource/vowel/vowelchart.png index bb41c90f..812ed323 100644 Binary files a/phsource/vowel/vowelchart.png and b/phsource/vowel/vowelchart.png differ diff --git a/phsource/vwl_en_us/3_us b/phsource/vwl_en_us/3_us index bccb47d3..ae161298 100644 Binary files a/phsource/vwl_en_us/3_us and b/phsource/vwl_en_us/3_us differ diff --git a/phsource/vwl_en_us/a b/phsource/vwl_en_us/a index 951ece23..4ccbbf1d 100644 Binary files a/phsource/vwl_en_us/a and b/phsource/vwl_en_us/a differ diff --git a/phsource/vwl_en_us/ee b/phsource/vwl_en_us/ee index e5a5f82e..c0792092 100644 Binary files a/phsource/vwl_en_us/ee and b/phsource/vwl_en_us/ee differ diff --git a/phsource/vwl_en_us/ei b/phsource/vwl_en_us/ei index 5292771b..5882bb02 100644 Binary files a/phsource/vwl_en_us/ei and b/phsource/vwl_en_us/ei differ diff --git a/phsource/vwl_zh/aau b/phsource/vwl_zh/aau new file mode 100644 index 00000000..7afb410a Binary files /dev/null and b/phsource/vwl_zh/aau differ diff --git a/phsource/vwl_zh/ang b/phsource/vwl_zh/ang new file mode 100644 index 00000000..35fa88cc Binary files /dev/null and b/phsource/vwl_zh/ang differ diff --git a/phsource/vwl_zh/eng b/phsource/vwl_zh/eng new file mode 100644 index 00000000..b8f2f88a Binary files /dev/null and b/phsource/vwl_zh/eng differ diff --git a/phsource/vwl_zh/i& b/phsource/vwl_zh/i& new file mode 100644 index 00000000..f75c7501 Binary files /dev/null and b/phsource/vwl_zh/i& differ diff --git a/phsource/vwl_zh/i_dnt b/phsource/vwl_zh/i_dnt new file mode 100644 index 00000000..edd92f9c Binary files /dev/null and b/phsource/vwl_zh/i_dnt differ diff --git a/phsource/vwl_zh/i_rfx b/phsource/vwl_zh/i_rfx new file mode 100644 index 00000000..ab177dc6 Binary files /dev/null and b/phsource/vwl_zh/i_rfx differ diff --git a/phsource/vwl_zh/iaa b/phsource/vwl_zh/iaa new file mode 100644 index 00000000..7fc758bb Binary files /dev/null and b/phsource/vwl_zh/iaa differ diff --git a/phsource/vwl_zh/iaau b/phsource/vwl_zh/iaau new file mode 100644 index 00000000..2c8303a7 Binary files /dev/null and b/phsource/vwl_zh/iaau differ diff --git a/phsource/vwl_zh/iee b/phsource/vwl_zh/iee new file mode 100644 index 00000000..886e0fa9 Binary files /dev/null and b/phsource/vwl_zh/iee differ diff --git a/phsource/vwl_zh/iee_n b/phsource/vwl_zh/iee_n new file mode 100644 index 00000000..80c30d37 Binary files /dev/null and b/phsource/vwl_zh/iee_n differ diff --git a/phsource/vwl_zh/ing b/phsource/vwl_zh/ing new file mode 100644 index 00000000..e3a7322e Binary files /dev/null and b/phsource/vwl_zh/ing differ diff --git a/phsource/vwl_zh/iou b/phsource/vwl_zh/iou new file mode 100644 index 00000000..55fa474e Binary files /dev/null and b/phsource/vwl_zh/iou differ diff --git a/phsource/vwl_zh/ng b/phsource/vwl_zh/ng new file mode 100644 index 00000000..952770d5 Binary files /dev/null and b/phsource/vwl_zh/ng differ diff --git a/phsource/vwl_zh/oeng b/phsource/vwl_zh/oeng new file mode 100644 index 00000000..25a5a3c1 Binary files /dev/null and b/phsource/vwl_zh/oeng differ diff --git a/phsource/vwl_zh/ua b/phsource/vwl_zh/ua new file mode 100644 index 00000000..480af2d9 Binary files /dev/null and b/phsource/vwl_zh/ua differ diff --git a/phsource/vwl_zh/uaa b/phsource/vwl_zh/uaa new file mode 100644 index 00000000..d7fd362e Binary files /dev/null and b/phsource/vwl_zh/uaa differ diff --git a/phsource/vwl_zh/uai b/phsource/vwl_zh/uai new file mode 100644 index 00000000..afc62822 Binary files /dev/null and b/phsource/vwl_zh/uai differ diff --git a/phsource/vwl_zh/uee_n b/phsource/vwl_zh/uee_n new file mode 100644 index 00000000..9b4c0620 Binary files /dev/null and b/phsource/vwl_zh/uee_n differ diff --git a/phsource/vwl_zh/uei b/phsource/vwl_zh/uei new file mode 100644 index 00000000..fc9b1cc7 Binary files /dev/null and b/phsource/vwl_zh/uei differ diff --git a/phsource/vwl_zh/ung b/phsource/vwl_zh/ung new file mode 100644 index 00000000..506943b1 Binary files /dev/null and b/phsource/vwl_zh/ung differ diff --git a/phsource/vwl_zh/uo b/phsource/vwl_zh/uo new file mode 100644 index 00000000..704b1035 Binary files /dev/null and b/phsource/vwl_zh/uo differ diff --git a/phsource/vwl_zh/y& b/phsource/vwl_zh/y& new file mode 100644 index 00000000..0b94f41d Binary files /dev/null and b/phsource/vwl_zh/y& differ diff --git a/phsource/vwl_zh/y_n b/phsource/vwl_zh/y_n new file mode 100644 index 00000000..64557fff Binary files /dev/null and b/phsource/vwl_zh/y_n differ diff --git a/phsource/vwl_zh/ya b/phsource/vwl_zh/ya new file mode 100644 index 00000000..92a71e96 Binary files /dev/null and b/phsource/vwl_zh/ya differ diff --git a/phsource/vwl_zh/yee b/phsource/vwl_zh/yee new file mode 100644 index 00000000..47babdc7 Binary files /dev/null and b/phsource/vwl_zh/yee differ diff --git a/src/debug.cpp b/src/debug.cpp index 76d72350..38ea57c9 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -12,8 +12,8 @@ static const char* FILENAME="/tmp/espeak.log"; void debug_init() { - fd_log = fopen(FILENAME,"a"); - setvbuf(fd_log, NULL, _IONBF, 0); + if((fd_log = fopen(FILENAME,"a")) != NULL) + setvbuf(fd_log, NULL, _IONBF, 0); } void debug_enter(const char* text) diff --git a/src/dictionary.cpp b/src/dictionary.cpp index cf98bcf1..466f864f 100755 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -490,7 +490,7 @@ void Translator::GetTranslatedPhonemeString(char *phon_out, int n_phon_out) int stress; PHONEME_LIST *plist; - static const char *stress_chars = "==,,'*"; + static const char *stress_chars = "==,,''"; if(phon_out != NULL) { @@ -2199,6 +2199,7 @@ int Translator::TranslateRules(char *p_start, char *phonemes, int ph_size, char int g1; /* first group for this letter */ int n; int letter; + int any_alpha=0; int ix; int digit_count=0; char *p; @@ -2245,11 +2246,13 @@ int Translator::TranslateRules(char *p_start, char *phonemes, int ph_size, char while(((c = *p) != ' ') && (c != 0)) { + if(IsAlpha(wc)) + any_alpha = wc; wc_prev = wc; wc_bytes = utf8_in(&wc,p,0); n = groups2_count[c]; - if(IsDigit(wc) && ((langopts.tone_numbers == 0) || !IsAlpha(wc_prev))) + if(IsDigit(wc) && ((langopts.tone_numbers == 0) || !any_alpha)) { // lookup the number in *_list not *_rules char string[8]; diff --git a/src/intonation.cpp b/src/intonation.cpp index b786f2b0..b6876d95 100755 --- a/src/intonation.cpp +++ b/src/intonation.cpp @@ -814,6 +814,8 @@ void Translator::CalcPitches_Tone(int clause_tone) int final_stressed=0; int tone_ph; + int pause; + int tone_promoted; PHONEME_TAB *tph; PHONEME_TAB *prev_tph; // forget across word boundary PHONEME_TAB *prevw_tph; // remember across word boundary @@ -849,13 +851,21 @@ void Translator::CalcPitches_Tone(int clause_tone) } + pause = 1; + tone_promoted = 0; + prev_p = p = &phoneme_list[0]; prev_tph = prevw_tph = phoneme_tab[phonPAUSE]; // perform tone sandhi for(ix=0; ixnewword) && ((option_tone1 & 1)==0)) + if((p->type == phPAUSE) && (p->ph->std_length > 50)) + { + pause = 1; // there is a pause since the previous vowel + } + + if(p->newword) { prev_tph = phoneme_tab[phonPAUSE]; // forget across word boundaries } @@ -863,14 +873,32 @@ void Translator::CalcPitches_Tone(int clause_tone) if(p->type == phVOWEL) { tone_ph = p->tone_ph; - if(tone_ph == 0) - p->tone_ph = tone_ph = LookupPh("11"); // default tone 5 - tph = phoneme_tab[tone_ph]; // Mandarin if(translator_name == L('z','h')) { + if(tone_ph == 0) + { + if(pause || tone_promoted) + { + tone_ph = LookupPh("55"); // no previous vowel, use tone 1 + tone_promoted = 1; + } + else + { + tone_ph = LookupPh("11"); // default tone 5 + } + + p->tone_ph = tone_ph; + tph = phoneme_tab[tone_ph]; + + } + else + { + tone_promoted = 0; + } + if(prev_tph->mnemonic == 0x343132) // [214] { if(tph->mnemonic == 0x343132) // [214] @@ -901,6 +929,7 @@ void Translator::CalcPitches_Tone(int clause_tone) prev_p = p; prev2_tph = prevw_tph; prevw_tph = prev_tph = tph; + pause = 0; } }