From 8a6e17ac7c25334ca4de7e18d29a1c3f6b338fe7 Mon Sep 17 00:00:00 2001 From: jonsd Date: Mon, 21 May 2007 17:10:30 +0000 Subject: [PATCH] [1.25.02] Added translation for mbrola "gr2" Greek voice. Filtered ustop/t_short.wav to remove high frequencies. Reduced formant glide for phoneme [c]. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@18 d46cf337-b52f-0410-862d-fd96e6ae7743 --- dictsource/dict_phonemes | 3 +- dictsource/el_list | 10 ++-- dictsource/el_rules | 40 +++++++++++---- dictsource/en_rules | 1 + dictsource/hu_rules | 22 ++++---- phsource/compile_report | 11 ++-- phsource/mbrola/cr1 | 2 +- phsource/mbrola/gr2 | 102 +++++++++++++++++++++++++++++++++++++ phsource/ph_croatian | 18 +++++++ phsource/ph_greek | 9 +++- phsource/ph_hungarian | 19 +++++++ phsource/phonemes | 4 +- phsource/r3/r_trill | Bin 5811 -> 5811 bytes phsource/ustop/t_short.wav | Bin 1194 -> 1194 bytes src/synthdata.cpp | 2 +- src/synthesize.cpp | 7 +++ src/tr_languages.cpp | 4 +- src/translate.cpp | 8 ++- src/translate.h | 3 ++ 19 files changed, 227 insertions(+), 38 deletions(-) create mode 100644 phsource/mbrola/gr2 diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index 3af08fe5..b22f7993 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -53,7 +53,8 @@ x z Dictionary el_dict -@- a aI e i o oI u +@ @- a aI e i o oI +u * ; b c C d D f g j k l l^ m n N diff --git a/dictsource/el_list b/dictsource/el_list index dade0c10..d4065347 100644 --- a/dictsource/el_list +++ b/dictsource/el_list @@ -11,8 +11,8 @@ _0 miD'en _1 'ena _2 D'io -_3 tr'ia -_3f tr'is +_3 t@-@'ia +_3f t@-@'is _4 t'esera _4f t'eseris _5 p'ente @@ -24,7 +24,7 @@ _1X D'eka _11 'enDeka _12 D'oDeka _2X 'ikosi -_3X tri'anda +_3X t@-*i'anda _4X sar'anda _5X pen'inda _6X eks'inda @@ -35,8 +35,8 @@ _0C ekat'on_ _1C0 ekat'o _1C ekat'on_ _2C D;ak'os;a_ -_3C triak'os;a_ -_4C tetrak'os;a_ +_3C t@-*iak'os;a_ +_4C tet@-*ak'os;a_ _5C pendak'os;a_ _6C eksak'os;a_ _7C eptak'os;a_ diff --git a/dictsource/el_rules b/dictsource/el_rules index e09a1016..575d0e9d 100644 --- a/dictsource/el_rules +++ b/dictsource/el_rules @@ -6,6 +6,9 @@ // Α α, Β β, Γ γ, Δ δ, Ε ε, Ζ ζ, Η η, Θ θ, Ι ι, Κ κ, Λ λ, Μ μ, Ν ν, Ξ ξ, // Ο ο, Π π, Ρ ρ, Σ σ ς (word-final form), Τ τ, Υ υ, Φ φ, Χ χ, Ψ ψ, Ω ω. +// Y: ε η ι υ (+tonos variants, front vowels). + + .group α α a αι e @@ -83,6 +86,12 @@ κ (κ ν_) κ g + κ (Y c + κ (αι c + κ (αί c + κ (οι c + κ (οί c + κη (A c // k + i sound = [c] κι (A c κυ (A c @@ -111,7 +120,9 @@ ν (_π m ν (_ψ m ν (_κ N + ν (_και_ n // there is a pause before και ν (_ξ N + νη (A n^ νι (A n^ νυ (A n^ @@ -141,13 +152,21 @@ .group ρ ρ R - ρ (ρ + ρρ R A) ρ (A * - C) ρ (A @-* + C) ρ @-* + + αυ) ρ @-* // υ becomes consionant [v] + αύ) ρ @-* + ευ) ρ @-* + εύ) ρ @-* + ηυ) ρ @-* + ηύ) ρ @-* + .group σ σ s - σ (σ +// ?? σ (σ ση (A s; σι (A s; συ (A s; @@ -179,18 +198,17 @@ .group χ χ x + χ (Y C χ (αι C χ (αί C - χ (ε C - χ (έ C - χ (η C - χ (ή C - χ (ι C - χ (ί C χ (οι C χ (οί C - χ (υ C - χ (ύ C + + χει (A C + χη (A C + χι (A C + χοι (A C + χυ (A C .group ψ ψ ps diff --git a/dictsource/en_rules b/dictsource/en_rules index 4e3d2d43..c795b1ae 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -4168,6 +4168,7 @@ queu kju: qu (_ k quay ki: + jac) qu k li) quor k3 quy kwI diff --git a/dictsource/hu_rules b/dictsource/hu_rules index 8a95804d..ede4b11d 100644 --- a/dictsource/hu_rules +++ b/dictsource/hu_rules @@ -22,7 +22,7 @@ d d dd d: dz dz - A) dz (A dz: + A) dz (A d:z dzs dZ A) dzs dZ: @@ -33,9 +33,8 @@ dsz (C ts A) dsz (A ts: dz dz - A) dz (A d:z - C) dzs Z - A) dzs (A Z: + C) dzs dZ + A) dzs (A dZ: C) dj J A) dj (A J: @@ -66,8 +65,8 @@ A) gysz (A ts: gyz dz A) gyz (A d:z - C) gyzs Z - A) gyzs (A Z: + C) gyzs dZ + A) gyzs (A dZ: C) gyj J A) gyj (A J: @@ -92,6 +91,7 @@ .group l l l ly j + lly jj lj jj .group m @@ -104,6 +104,7 @@ n (p m n (b m ny n^ + nny n^n^ ny (k N ny (g N @@ -162,10 +163,10 @@ A) tz (A d:z tyz dz A) tyz (A d:z - C) tzs Z - A) tzs (A Z: - C) tyzs Z - A) tyzs (A Z: + C) tzs dZ + A) tzs (A dZ: + C) tyzs dZ + A) tyzs (A dZ: C) tj c A) tj (A c: C) tyj c @@ -200,6 +201,7 @@ .group z z z zs Z + zzs Z: .group diff --git a/phsource/compile_report b/phsource/compile_report index 87e8c529..682ee354 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -15,19 +15,19 @@ fr 33 115 fr_ca 11 115 hi 49 127 - hu 24 109 + hu 26 111 nl 25 112 pl 17 103 sk 25 120 cs 5 120 - hr 24 130 + hr 26 132 ru 36 120 it 28 112 es 6 112 pt 25 127 pt_pt 17 127 ro 36 136 - el 7 112 + el 8 112 sv 25 114 no 29 118 is 27 113 @@ -184,7 +184,10 @@ 1 r3/r_i base 6 r3/r_n base cy eo fr pl ru 1 r3/r_o base + 2 r3/r_test1.wav hu hr + 2 r3/r_test2.wav hu hr 3 r3/r_trill base eo it + 4 r3/r_trill2 hu hr 3 r3/r_trill.wav base eo it 1 r3/r_u base 28 r3/rx base af cy eo fr fr_ca pl ru pt_pt ro is @@ -446,7 +449,7 @@ 10 vowel/e_mid2 af de fi nl sk ro el sw 1 vowel/@_fnt hr 1 vowel/@_hgh no - 17 vowel/i en_n en_rp en_wm cy eo fr hu pl it pt pt_pt ro ++ + 18 vowel/i en_n en_rp en_wm cy eo fr hu pl it pt pt_pt ro ++ 1 vowel/i# cy 3 vowel/i_2 de nl sv 2 vowel/i_3 af sk diff --git a/phsource/mbrola/cr1 b/phsource/mbrola/cr1 index 34a25c3f..026a7258 100644 --- a/phsource/mbrola/cr1 +++ b/phsource/mbrola/cr1 @@ -48,7 +48,7 @@ volume 16 0 a a 5 a _ 0 & a 5 a _ -// map English phonemes to Hungarian +// map English phonemes to Croatian 0 3 r 5 r _ 0 @ NULL 0 a 0 eI NULL 60 e j diff --git a/phsource/mbrola/gr2 b/phsource/mbrola/gr2 new file mode 100644 index 00000000..e7c73a77 --- /dev/null +++ b/phsource/mbrola/gr2 @@ -0,0 +1,102 @@ +volume 16 + +0 l/2 NULL 0 l +0 l/ NULL 0 l +0 r/ r 5 r _ +2 r p 0 R +2 r b 0 R +2 r t 0 R +2 r d 0 R +2 r k 0 R +2 r g 0 R +2 r m 0 R +2 r n 0 R +2 r l/2 0 R +2 r f 0 R +2 r v 0 R +2 r T 0 R +2 r s 0 R +2 r z 0 R + +0 r 3 5 r _ +0 r/ NULL 0 r +2 R z 0 R +0 R NULL 0 r +0 r- NULL 0 r +0 l- NULL 0 l +0 w/ NULL 0 w +0 j/ NULL 0 j +2 ; i 0 NULL +0 ; NULL 0 j +0 - NULL 0 NULL +0 g- NULL 0 NULL + +1 @- * 0 R +0 @- NULL 0 NULL +0 * NULL 0 r + +0 N g 0 V +0 N J 0 V +0 N NULL 0 n +0 J NULL 0 q +0 Q NULL 0 G +1 m ; 0 M +0 n^ NULL 0 N +0 l^ NULL 0 L +0 ts NULL 0 S +0 dz NULL 0 Z +1 d z 0 Z +1 k s 0 X +1 p s 0 Y +0 s; NULL 0 s +0 z; NULL 0 z + +0 aI NULL 60 a i +0 oI NULL 60 o i +0 a/ NULL 0 a + + +// map English phonemes to Greek +0 3 NULL 60 e r +0 @ NULL 0 a +0 eI NULL 60 e i +0 aU NULL 60 a u +0 oU NULL 0 o +0 @L NULL 40 e l +0 @2 NULL 0 e // @ +0 @5 NULL 0 e // @ +0 3 NULL 0 r // @ +0 a2 NULL 0 a // @ +0 I2 NULL 0 i +0 I NULL 0 i +0 a NULL 0 a +0 aa NULL 0 a +0 V NULL 0 a // @ +0 U NULL 0 u +0 0 NULL 0 o +0 i: NULL 0 i +0 u: NULL 0 u +0 A: NULL 0 a +0 3: NULL 60 e r // @ +//0 aI NULL 60 a j +0 OI NULL 60 o j +0 i@ NULL 60 i r // @ +0 e@ NULL 70 e r +0 o@ NULL 70 o r // @ +0 O@ NULL 70 o r // @ +0 O NULL 0 o +0 O: NULL 0 a +0 A: NULL 0 a +0 A@ NULL 70 a r +0 U@ NULL 60 u r // @ +0 aI@ NULL 70 a r // @ +0 aU@ NULL 0 a + +0 E NULL 0 e +0 w NULL 0 v +0 h NULL 0 x +0 tS VWL 0 c +0 tS NULL 0 S +0 dZ VWL 0 q +0 dZ NULL 0 Z + diff --git a/phsource/ph_croatian b/phsource/ph_croatian index 937f7bf2..96c72ac5 100644 --- a/phsource/ph_croatian +++ b/phsource/ph_croatian @@ -184,4 +184,22 @@ phoneme x switchvoicing Q endphoneme +phoneme R2 // test + liquid + vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk + formants r3/r_trill2+r3/r_test1.wav%140 + trill + lengthmod 6 +endphoneme + +phoneme R3 // test + liquid + vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk + formants r3/r_trill2+r3/r_test2.wav%140 + trill + lengthmod 6 +endphoneme + diff --git a/phsource/ph_greek b/phsource/ph_greek index 5867a81e..97c8d256 100644 --- a/phsource/ph_greek +++ b/phsource/ph_greek @@ -16,6 +16,13 @@ phoneme e formants vowel/e_mid2 endphoneme +phoneme i + vowel starttype (i) endtype (i) + length 140 + formants vowel/i + linkout ; +endphoneme + phoneme o vowel starttype (o) endtype (o) length 180 @@ -28,7 +35,7 @@ endphoneme phoneme t // revert to alveolar /t/ vls alv stop - vowelin f1=0 f2=1700 -300 300 f3=-100 80 + vowelin f1=1 f2=1700 -300 300 f3=-100 80 rms=30 vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 lengthmod 2 wave ustop/t_short%80 diff --git a/phsource/ph_hungarian b/phsource/ph_hungarian index 9e6676bd..7be3f573 100644 --- a/phsource/ph_hungarian +++ b/phsource/ph_hungarian @@ -202,4 +202,23 @@ phoneme s2 // second part of geminated [s:] endphoneme +phoneme R2 // test + liquid + vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk + formants r3/r_trill2+r3/r_test1.wav%140 + trill + lengthmod 6 +endphoneme + +phoneme R3 // test + liquid + vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk + formants r3/r_trill2+r3/r_test2.wav%140 + trill + lengthmod 6 +endphoneme + + diff --git a/phsource/phonemes b/phsource/phonemes index fd1edaed..83c32a9c 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -924,8 +924,8 @@ endphoneme phoneme c vls pal stop - vowelin f1=0 f2=2700 400 600 f3=500 80 rate len=80 - vowelout f1=0 f2=2700 400 600 f3=300 80 + vowelin f1=0 f2=2700 200 500 f3=500 80 rate len=80 + vowelout f1=0 f2=2700 300 500 f3=300 80 lengthmod 2 wave ustop/c%130 before _ ustop/ki%80 diff --git a/phsource/r3/r_trill b/phsource/r3/r_trill index bf0453a6b0a1e4a8043a343d84bc562916a2b703..8ffd859091c0cf02e7499b4d1e02afddc8200404 100644 GIT binary patch delta 12 Tcmdn2yIFUFD5Kj(vAJRZ9lr!8 delta 12 Tcmdn2yIFUFD5LjAvAJRZ9oPgc diff --git a/phsource/ustop/t_short.wav b/phsource/ustop/t_short.wav index a36f73a8cd14a90ca5b0ed8f4e77420baf7f9ec0..6497b67d9e58f3fdd015033b25866d0d56a8742b 100644 GIT binary patch literal 1194 zcmWMkdrXye7=GUO_kHJ>ib7&j$|>fwjUdw!8CdGfOL^M{`@`mO$U8IB; zOz@r*8kt&(8tO)hO*@h%t7bU~#oH9{z&YRd`@Nk#f4QZK9qSLpx=y$))$z0X~i|jTg(*15Uvf37WI!d)$Xl1|f;OG=*No^Rk#yR5=@( ziXIrn2l*ED;tIM(c^p7Gu2Y8bg}yc)s!X0lF3w{WJ(8_*jLWH3j?(t9_X@fbR_McT z=1<9_1=0@t>2Ewo^%5=1D4&*K63&@&sisRT z954IC$7iTJ9Wx!IiIvA!aA~@Vi(cO|k+-l*9!n6ODNY?+LGeA5+yM_j$$zYujm`n)!r=~^_ssxU*h2zx)s0V&XH z2x!&|X{<~z>)9_=`d&Ec3Pf1d6w>90S51hc0(FFQkt1!9%~iaaW}(*Xpw`xQ>PRuB z#4WOKs1wdW_EDW%Y^`p~H4yCD1NaZ}UNXsB|N6R`B#TSvlEay$F)u1cg z1@^bt7S{5nlS-SdY3@F?kLrRic{*6PgU2Y79rG9U4zDClCY!#NHtXo5cSuvBb2VZf zN<*<~zgtBsz1cd&G?*RkL{6qM-l)zrw~_P~Jtbg__?`dMChMk|#IqzQW*(|inU#VWly-py-uyyfHOg`p1KFVs-oSE})y ztTZ#_J^t0&jt5R}tI%8My6zpG4VN!-hLovFJ+ryqn&`RfyyG4wk3AimokYcIm)nc8 z_$%4QPuyKjd)0|+(3^*;Vin^$=CLQsonZ!gJ`FD9D{WRc_h>5c=JFwHsoEXbB02U` ay%7=Sf@!pqoduycJaHz+U1R?!bIkuZCjLMG literal 1194 zcmWMkYiv|i7@Y5%bMG$c69Y=6i4=(>qM*DiVX5I^TPzPnf$)+vSttU9R%;1uf`Fow zhcya9iVYDXwz7bQN?BfZK`KfUT#Hx>2#o}hT7d%X?%sRO=VpG)pUKQ5GczVn?zDF6th!k=G~zb3BPiM7~ieLo5=X%l}0YdqZ2 zxFhzV(wtW@mg;e8q*}3(?otbPQME~lrE|MTkf%{Z71%_#_&Ud^Rs3KIL;#0OKY4-+ zaS2VjGu}L%`_P9drsdRV0(b)B#ZDaIRXmr^(rD7W0dugP{J5bjrNdzppfckXKk`Pb zq60`0b9H;X`Dc2*7@?EoQ0r>XLc0b-_^h3$ds9BL;EMnBLQa-NX1Y2DpFXPYxJ?vB zg`P-*Wu9r(yUEbkW(oeVnxg_;vY0mNQ~H!u%VDn5J-9Fa)lDcvz39UoaNSMZVzrtr zx=y4cNC(Mh!lom>j0Xv#iie1k9MV;yFAYL7SBPJAn@G0$MV47QdYsDER{tM&HL?hGqpNK3+ zS*t`4^>T%CRNu01V}tS2r~Ew{XsmqIeN@hrPel&c^Hpw72w~Y*eS{*DskeB@%p*-F z9iJx?-O-T8a>HhaeKYo~=XsoY5J}wchNx65(YAdErMe^j>r62b=c1RbJbDGok!Y@| z{;-Tsw8Mw3dVpA)mpbnu#3ucV6!*5u_JIn{15KnZLXb%vRHjzKxAh$E-a9r8Q4K*7K)lg=piv=s=lf z&Eph,phoneme_tab[phonSCHWA],next->ph,1,p,0); } } + else + { + if(p->synthflags & SFLAG_LENGTHEN) + { + DoPause(50); + } + } if(pre_voiced) { diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 8d552bbe..d1215920 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -122,6 +122,7 @@ Translator *SelectTranslator(const char *name) // character codes offset by 0x380 static const char el_vowels[] = {0x10,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x35,0x37,0x39,0x3f,0x45,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0}; + static const char el_fvowels[] = {0x2d,0x2e,0x2f,0x35,0x37,0x39,0x45,0x4d,0}; static const char el_voiceless[]= {0x38,0x3a,0x3f,0x40,0x42,0x43,0x44,0x46,0x47,0}; static const char el_consonants[]={0x32,0x33,0x34,0x36,0x38,0x3a,0x3b,0x3c,0x3d,0x3e,0x40,0x41,0x42,0x43,0x44,0x46,0x47,0x48,0}; static const wchar_t el_char_apostrophe[] = {0x3c3,0}; // σ @@ -137,6 +138,7 @@ Translator *SelectTranslator(const char *name) SetLetterBits(tr,LETTERGP_A,el_vowels); SetLetterBits(tr,LETTERGP_B,el_voiceless); SetLetterBits(tr,LETTERGP_C,el_consonants); + SetLetterBits(tr,LETTERGP_Y,el_fvowels); // front vowels: ε η ι υ tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->langopts.stress_rule = 2; @@ -321,7 +323,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.stress_rule = 0; tr->langopts.stress_flags = 0x56; // move secondary stress from light to a following heavy syllable - tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; + tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x1; tr->langopts.param[LOPT_IT_DOUBLING] = 1; tr->langopts.long_stop = 130; diff --git a/src/translate.cpp b/src/translate.cpp index 341f05ac..030ae748 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -1150,8 +1150,8 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne if(sylimit & 0x100) { // only if the second word has $alt attribute - strcpy(ph_buf,word_phonemes); flags2 = translator->TranslateWord(p2+1, 0, wtab+1); + strcpy(ph_buf,word_phonemes); if((flags2 & FLAG_ALT_TRANS) == 0) { ok = 0; @@ -1159,6 +1159,12 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne } } + if((sylimit & 0x200) && ((wtab+1)->flags & FLAG_LAST_WORD)) + { + // not if the next word is end-of-sentence + ok = 0; + } + if(ok) { *p2 = '-'; // replace next space by hyphen diff --git a/src/translate.h b/src/translate.h index 2368c8b8..df795125 100755 --- a/src/translate.h +++ b/src/translate.h @@ -236,6 +236,9 @@ extern const int param_defaults[N_SPEECH_PARAM]; // don't reduce the strongest vowel in a word which is marked 'unstressed' #define LOPT_KEEP_UNSTR_VOWEL 10 // LANG=cs,sk combine some prepositions with the following word, if the combination has N or fewer syllables + // bits 0-3 N syllables + // bit 4=only if the second word has $alt attribute + // bit 5=not if the second word is end-of-sentence #define LOPT_COMBINE_WORDS 11