Changes to voice: en-r

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@97 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-11-06 09:33:54 +00:00
parent 74e4e9b09e
commit bd79fee87d
41 changed files with 110 additions and 68 deletions
+6
View File
@@ -346,6 +346,12 @@ x z Z
Dictionary zh_dict 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 Dictionary zhh_dict
+4 -1
View File
@@ -8,7 +8,10 @@ phonemes en_us
dictrules 3 6 dictrules 3 6
option 12 1 // reduce [t] 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 stressAmp 17 16 20 20 20 22 23 20
//replace 03 I i
//replace 03 I2 i
formant 1 99 100 100 formant 1 99 100 100
+18 -20
View File
@@ -272,7 +272,6 @@ l/L2_oL [(o)] base
l/L2_uL [(u)] base l/L2_uL [(u)] base
[u:] en [u:] en
[u:] en_n [u:] en_n
[u:] en_us
[u:] en_rp [u:] en_rp
l/l_3 [l/] de l/l_3 [l/] de
[l] fr [l] fr
@@ -847,8 +846,7 @@ vdiph/eei [EI] base2
[EI] de [EI] de
[EI] nl [EI] nl
[EI] vi [EI] vi
vdiph/eei_2 [eI] en_us vdiph/eei_2 [eI] eo
[eI] eo
[ei] fi [ei] fi
vdiph/eei_3 [eI] en_rp vdiph/eei_3 [eI] en_rp
[eI] sk [eI] sk
@@ -900,7 +898,6 @@ vdiph/oi [oI] base2
vdiph/oi_2 [oI] af vdiph/oi_2 [oI] af
vdiph/ooi [OI] en vdiph/ooi [OI] en
[OI] en_n [OI] en_n
[OI] en_us
[OI] cy [OI] cy
[OY] cy [OY] cy
[OI] eo [OI] eo
@@ -908,7 +905,8 @@ vdiph/ooi [OI] en
[OI] no [OI] no
[oi] zhy [oi] zhy
vdiph/ooi_2 [OI] af vdiph/ooi_2 [OI] af
vdiph/ooi_3 [OI] en_rp vdiph/ooi_3 [OI] en_us
[OI] en_rp
[aI] en_wm [aI] en_wm
vdiph/oou [oU] cs vdiph/oou [oU] cs
[OU] grc [OU] grc
@@ -1050,9 +1048,6 @@ vowel/@ [@] base
[@] en [@] en
[@2] en [@2] en
[@5] en [@5] en
[@] en_us
[@2] en_us
[@5] en_us
[3] en_rp [3] en_rp
[@] en_rp [@] en_rp
[V] cy [V] cy
@@ -1081,9 +1076,7 @@ vowel/0_3 [O:] en_us
[A] hu [A] hu
vowel/@_2 [@] fr vowel/@_2 [@] fr
[W] fr [W] fr
vowel/&_2 [a] en_us vowel/&_2 [&?] zhh
[aa] en_us
[&?] zhh
vowel/@_3 [@] en_sc vowel/@_3 [@] en_sc
[I] en_sc [I] en_sc
[@2] en_sc [@2] en_sc
@@ -1234,7 +1227,6 @@ vowel/ee_1 [E] base2
[E:] no [E:] no
[e] zhy [e] zhy
vowel/ee_2 [E] en vowel/ee_2 [E] en
[E] en_us
[E] cy [E] cy
[E2] nl [E2] nl
[E] zh [E] zh
@@ -1271,7 +1263,10 @@ vowel/e_mid2 [E] af
vowel/@_fnt [@2] hr vowel/@_fnt [@2] hr
[@] en_wi [@] en_wi
[@2] en_wi [@2] en_wi
vowel/@_hgh [@] no vowel/@_hgh [@] en_us
[@2] en_us
[@5] en_us
[@] no
vowel/i [i] base2 vowel/i [i] base2
[i:] en_n [i:] en_n
[i] en_wm [i] en_wm
@@ -1292,7 +1287,8 @@ vowel/i [i] base2
[i?] zhh [i?] zhh
[i] sw [i] sw
[i] en_wi [i] en_wi
vowel/i# [i] en_rp vowel/i# [i] en_us
[i] en_rp
[y:] cy [y:] cy
vowel/i_2 [i:] en_rp vowel/i_2 [i:] en_rp
[i2] de [i2] de
@@ -1464,12 +1460,12 @@ vowel/u_2 [u1] fi
[U] hr [U] hr
[u] ro [u] ro
vowel/u#_2 [u-] sv vowel/u#_2 [u-] sv
vowel/u_3 [u:] en_us vowel/u_3 [yU] ro
[yU] ro
vowel/u_4 [u:] en_n vowel/u_4 [u:] en_n
vowel/u#_4 [U] en_sc vowel/u#_4 [U] en_sc
[u:] en_sc [u:] en_sc
vowel/u_5 [u] sw vowel/u_5 [u] sw
vowel/u#_5 [u:] en_us
vowel/u_6 [U] pt_pt vowel/u_6 [U] pt_pt
[u] pt_pt [u] pt_pt
vowel/u_7 [u] vi vowel/u_7 [u] vi
@@ -1509,9 +1505,9 @@ vowel/uu_bck [U] en_n
[U] no [U] no
[u] zhy [u] zhy
[U] en_wi [U] en_wi
vowel/V [3] en_sc vowel/V [V] en_us
[3] en_sc
vowel/V_2 [V] en vowel/V_2 [V] en
[V] en_us
[a] af [a] af
[V] ru [V] ru
[V#] ru [V#] ru
@@ -1594,15 +1590,17 @@ vwl_en_rp/oo [U@] en_rp
vwl_en/u [u:] en vwl_en/u [u:] en
vwl_en/u_L [u:] en vwl_en/u_L [u:] en
[u:] en_n [u:] en_n
[u:] en_us
[u:] en_rp [u:] en_rp
vwl_en_us/3_us [3] en_us vwl_en_us/3_us [3] en_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/aai [aI] en_us
vwl_en_us/ar [A:] en_us vwl_en_us/ar [A:] en_us
[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/er [e@] en_us
vwl_en_us/i_final3 [i] en_us
vwl_en_us/ii [I] en_us vwl_en_us/ii [I] en_us
[I2] en_us [I2] en_us
vwl_en_us/ir [i@] en_us vwl_en_us/ir [i@] en_us
+42 -39
View File
@@ -7,7 +7,7 @@
phoneme @ // Schwa phoneme @ // Schwa
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
formants vowel/@ formants vowel/@_hgh
unstressed unstressed
linkout r- linkout r-
length 130 length 130
@@ -21,13 +21,13 @@ phoneme 3 // Schwa, used for rhotic schwa in American
unstressed unstressed
linkout r- linkout r-
beforevowel @ beforevowel @
length 180 length 200
endphoneme endphoneme
phoneme @2 // Schwa, changes to I before a vowel phoneme @2 // Schwa, changes to I before a vowel
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
formants vowel/@ formants vowel/@_hgh
unstressed unstressed
beforevowel I2 beforevowel I2
length 120 length 120
@@ -35,7 +35,7 @@ endphoneme
phoneme @5 // Schwa, changes to U before a vowel phoneme @5 // Schwa, changes to U before a vowel
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
formants vowel/@ formants vowel/@_hgh
unstressed unstressed
beforevowelpause U beforevowelpause U
length 130 length 130
@@ -53,18 +53,18 @@ endphoneme
phoneme a phoneme a
vowel starttype (a) endtype (@) vowel starttype (a) endtype (@)
length 180 length 200
formants vowel/&_2 // formants vowel/&_2
// formants vwl_en_us/a formants vwl_en_us/a
reduceto a2 0 reduceto a2 0
endphoneme endphoneme
phoneme aa // 'bath' etc. phoneme aa // 'bath' etc.
vowel starttype (a) endtype (@) vowel starttype (a) endtype (@)
length 190 length 220
formants vowel/&_2 // formants vowel/&_2
// formants vwl_en_us/a formants vwl_en_us/a
linkout r- linkout r-
endphoneme endphoneme
@@ -72,7 +72,7 @@ endphoneme
phoneme a2 phoneme a2
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
unstressed unstressed
length 140 length 150
formants vowel/a#_3 formants vowel/a#_3
linkout r- linkout r-
endphoneme endphoneme
@@ -80,15 +80,16 @@ endphoneme
phoneme E phoneme E
vowel starttype (e) endtype (e) vowel starttype (e) endtype (e)
length 160 length 185
formants vowel/ee_2 // formants vowel/ee_2
formants vwl_en_us/ee
reduceto I 0 reduceto I 0
endphoneme endphoneme
phoneme I phoneme I
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 130 length 120
formants vwl_en_us/ii formants vwl_en_us/ii
linkout ; linkout ;
endphoneme endphoneme
@@ -105,15 +106,16 @@ endphoneme
phoneme i // optional variant of [I] for end of words phoneme i // optional variant of [I] for end of words
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 170 length 200
formants vwl_en_us/i_final3 // formants vwl_en_us/i_final3
formants vowel/i#
linkout ; linkout ;
endphoneme endphoneme
phoneme 0 phoneme 0
vowel starttype (o) endtype (o) vowel starttype (o) endtype (o)
length 180 length 200
formants vowel/aa_8 formants vowel/aa_8
reduceto @ 0 reduceto @ 0
endphoneme endphoneme
@@ -121,9 +123,9 @@ endphoneme
phoneme V phoneme V
vowel starttype (a) endtype (@) vowel starttype (a) endtype (@)
length 170 length 165
// formants vwl_en_us/V // formants vowel/V_2
formants vowel/V_2 formants vowel/V
reduceto @ 0 reduceto @ 0
endphoneme endphoneme
@@ -154,7 +156,7 @@ endphoneme
phoneme 3: phoneme 3:
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
length 220 length 190
// formants vwl_en_us/@r_us2 // formants vwl_en_us/@r_us2
formants vwl_en_us/3_us formants vwl_en_us/3_us
// reduceto @ 0 // reduceto @ 0
@@ -164,7 +166,7 @@ endphoneme
phoneme i: phoneme i:
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 160 length 150
formants vowel/i_en formants vowel/i_en
after w w/wi2 after w w/wi2
linkout ; linkout ;
@@ -182,7 +184,7 @@ endphoneme
phoneme O@ phoneme O@
vowel starttype (o) endtype (@) vowel starttype (o) endtype (@)
length 240 length 270
formants vwl_en_us/oor formants vwl_en_us/oor
appendph r appendph r
endphoneme endphoneme
@@ -190,7 +192,7 @@ endphoneme
phoneme o@ phoneme o@
vowel starttype (o) endtype (@) vowel starttype (o) endtype (@)
length 240 length 270
formants vwl_en_us/or formants vwl_en_us/or
appendph r appendph r
endphoneme endphoneme
@@ -198,7 +200,7 @@ endphoneme
phoneme O phoneme O
vowel starttype (o) endtype (o) vowel starttype (o) endtype (o)
length 150 length 200
formants vwl_en_us/oo formants vwl_en_us/oo
reduceto @ 0 reduceto @ 0
endphoneme endphoneme
@@ -206,50 +208,51 @@ endphoneme
phoneme u: phoneme u:
vowel starttype (u) endtype (u) vowel starttype (u) endtype (u)
length 170 length 160
formants vowel/u_3 formants vowel/u#_5
before l/2 vwl_en/u_L-40+l/L2_uL // before l/2 vwl_en/u_L-40+l/L2_uL
endphoneme endphoneme
phoneme aU phoneme aU
vowel starttype (a) endtype (u) vowel starttype (a) endtype (u)
length 200 length 210
formants vdiph/au_2 formants vdiph/au_2
endphoneme endphoneme
phoneme oU phoneme oU
vowel starttype (@) endtype (u) vowel starttype (@) endtype (u)
length 210 length 240
formants vdiph/8u formants vdiph/8u
endphoneme endphoneme
phoneme aI phoneme aI
vowel starttype (a) endtype (i) vowel starttype (a) endtype (i)
length 210 length 235
formants vwl_en_us/aai formants vwl_en_us/aai
endphoneme endphoneme
phoneme eI phoneme eI
vowel starttype (e) endtype (i) vowel starttype (e) endtype (i)
length 210 length 235
formants vdiph/eei_2 // formants vdiph/eei_2
formants vwl_en_us/ei
endphoneme endphoneme
phoneme OI phoneme OI
vowel starttype (o) endtype (i) vowel starttype (o) endtype (i)
length 220 length 300
formants vdiph/ooi formants vdiph/ooi_3
endphoneme endphoneme
phoneme e@ phoneme e@
vowel starttype (e) endtype (@) vowel starttype (e) endtype (@)
length 250 length 280
formants vwl_en_us/er formants vwl_en_us/er
appendph r appendph r
endphoneme endphoneme
@@ -257,7 +260,7 @@ endphoneme
phoneme i@ phoneme i@
vowel starttype (i) endtype (@) vowel starttype (i) endtype (@)
length 220 length 230
formants vwl_en_us/ir formants vwl_en_us/ir
appendph r appendph r
endphoneme endphoneme
@@ -265,7 +268,7 @@ endphoneme
phoneme U@ phoneme U@
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)
length 220 length 230
formants vwl_en_us/ur formants vwl_en_us/ur
linkout r- linkout r-
endphoneme endphoneme
@@ -304,7 +307,7 @@ phoneme t# // reduced [t] as in "city"
vowelin f1=0 f2=1700 -300 300 f3=-100 80 vowelin f1=0 f2=1700 -300 300 f3=-100 80
vowelout f1=0 f2=1700 -300 300 f3=-100 80 vowelout f1=0 f2=1700 -300 300 f3=-100 80
lengthmod 5 lengthmod 5
wave x/d%80 wave x/d%70
endphoneme endphoneme
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -12,8 +12,8 @@ static const char* FILENAME="/tmp/espeak.log";
void debug_init() void debug_init()
{ {
fd_log = fopen(FILENAME,"a"); if((fd_log = fopen(FILENAME,"a")) != NULL)
setvbuf(fd_log, NULL, _IONBF, 0); setvbuf(fd_log, NULL, _IONBF, 0);
} }
void debug_enter(const char* text) void debug_enter(const char* text)
+5 -2
View File
@@ -490,7 +490,7 @@ void Translator::GetTranslatedPhonemeString(char *phon_out, int n_phon_out)
int stress; int stress;
PHONEME_LIST *plist; PHONEME_LIST *plist;
static const char *stress_chars = "==,,'*"; static const char *stress_chars = "==,,''";
if(phon_out != NULL) 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 g1; /* first group for this letter */
int n; int n;
int letter; int letter;
int any_alpha=0;
int ix; int ix;
int digit_count=0; int digit_count=0;
char *p; char *p;
@@ -2245,11 +2246,13 @@ int Translator::TranslateRules(char *p_start, char *phonemes, int ph_size, char
while(((c = *p) != ' ') && (c != 0)) while(((c = *p) != ' ') && (c != 0))
{ {
if(IsAlpha(wc))
any_alpha = wc;
wc_prev = wc; wc_prev = wc;
wc_bytes = utf8_in(&wc,p,0); wc_bytes = utf8_in(&wc,p,0);
n = groups2_count[c]; 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 // lookup the number in *_list not *_rules
char string[8]; char string[8];
+33 -4
View File
@@ -814,6 +814,8 @@ void Translator::CalcPitches_Tone(int clause_tone)
int final_stressed=0; int final_stressed=0;
int tone_ph; int tone_ph;
int pause;
int tone_promoted;
PHONEME_TAB *tph; PHONEME_TAB *tph;
PHONEME_TAB *prev_tph; // forget across word boundary PHONEME_TAB *prev_tph; // forget across word boundary
PHONEME_TAB *prevw_tph; // remember 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_p = p = &phoneme_list[0];
prev_tph = prevw_tph = phoneme_tab[phonPAUSE]; prev_tph = prevw_tph = phoneme_tab[phonPAUSE];
// perform tone sandhi // perform tone sandhi
for(ix=0; ix<n_phoneme_list; ix++, p++) for(ix=0; ix<n_phoneme_list; ix++, p++)
{ {
if((p->newword) && ((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 prev_tph = phoneme_tab[phonPAUSE]; // forget across word boundaries
} }
@@ -863,14 +873,32 @@ void Translator::CalcPitches_Tone(int clause_tone)
if(p->type == phVOWEL) if(p->type == phVOWEL)
{ {
tone_ph = p->tone_ph; tone_ph = p->tone_ph;
if(tone_ph == 0)
p->tone_ph = tone_ph = LookupPh("11"); // default tone 5
tph = phoneme_tab[tone_ph]; tph = phoneme_tab[tone_ph];
// Mandarin // Mandarin
if(translator_name == L('z','h')) 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(prev_tph->mnemonic == 0x343132) // [214]
{ {
if(tph->mnemonic == 0x343132) // [214] if(tph->mnemonic == 0x343132) // [214]
@@ -901,6 +929,7 @@ void Translator::CalcPitches_Tone(int clause_tone)
prev_p = p; prev_p = p;
prev2_tph = prevw_tph; prev2_tph = prevw_tph;
prevw_tph = prev_tph = tph; prevw_tph = prev_tph = tph;
pause = 0;
} }
} }