git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@206 d46cf337-b52f-0410-862d-fd96e6ae7743master
@@ -7,6 +7,9 @@ _cap m'aJ^us // should be "mayúscula" after the letter? | |||
_?? s'imbOlo | |||
_#32 Esp'aTjo | |||
// NOTE: Some of these pronunciations may still be in | |||
// Spanish, and need to be changed. | |||
// accent names | |||
_lig liQaD'u**a | |||
_acu aQ'uDo | |||
@@ -26,8 +29,6 @@ _stk b'a*Ra // ?? | |||
_tld t'ilde | |||
// names of symbols | |||
_. punto | |||
_, koma |
@@ -60,15 +60,15 @@ _75 _b'aI4||m'y@2j||l'a7m | |||
_85 t['a:3m||m'y@2j||l'a7m | |||
_95 c'i3n||m'y@2j||l'a7m | |||
_0C cr'am // trăm | |||
_0M1 N'a:2n // ngàn | |||
_0M2 cr'i@6w // triệu | |||
_0M3 t['i4 // tỷ | |||
_0and l,in^ // linh | |||
_dpt _f,@I4_ | |||
// symbols | |||
_, f@I4 | |||
// ?? found in festival wow_vi_ptn_phrasing.scm | |||
bị $u |
@@ -1,4 +1,4 @@ | |||
61 phoneme tables | |||
62 phoneme tables | |||
new total | |||
base 103 103 | |||
base2 24 122 | |||
@@ -61,6 +61,7 @@ | |||
om 25 125 | |||
en_klatt 77 149 | |||
ga 18 117 | |||
mr 1 148 | |||
Data file Used by | |||
b/b [b] base | |||
@@ -2321,7 +2322,8 @@ vowel/u_bck [u] base2 | |||
[u:] ga | |||
vowel/u_bck2 [u:] la | |||
[u] sq | |||
vowel/u_fnt [u:] en_rp | |||
vowel/u_fnt [u:] en | |||
[u:] en_rp | |||
vowel/uu [U] en | |||
[U] en_n | |||
[U] en_wm | |||
@@ -2431,7 +2433,6 @@ vwl_en_rp/aa [A:] en_rp | |||
[aa] en_rp | |||
vwl_en_rp/aU@ [aU@] en_rp | |||
vwl_en_rp/i@ [i@] en_rp | |||
vwl_en/u_L [u:] en | |||
vwl_en_us/3_us [3] en_us | |||
vwl_en_us/3_us2 [3:] en_us | |||
vwl_en_us/a [a] en_us |
@@ -1,6 +1,6 @@ | |||
ENVELOPE | |||
0 95 | |||
33 95 | |||
49 55 | |||
65 95 | |||
100 95 | |||
0 60 1 | |||
35 60 | |||
42 36 | |||
60 60 1 | |||
100 55 |
@@ -1,15 +1,12 @@ | |||
ENVELOPE | |||
0 100 | |||
34 100 | |||
47 66 | |||
64 100 | |||
73 100 | |||
74 0 | |||
85 95 | |||
86 95 | |||
92 95 | |||
94 0 | |||
100 0 | |||
0 50 1 | |||
40 50 | |||
50 33 | |||
68 50 1 | |||
77 50 | |||
78 0 | |||
88 50 1 | |||
100 50 | |||
@@ -253,7 +253,7 @@ phoneme u: | |||
vowel starttype (u) endtype (u) | |||
length 210 | |||
formants vdiph2/uw_2 | |||
before l/2 vwl_en/u_L-40+l/L2_uL | |||
before l/2 vowel/u_fnt-40+l/L2_uL | |||
endphoneme | |||
@@ -195,7 +195,6 @@ phoneme u: | |||
vowel starttype (u) endtype (u) | |||
length 190 | |||
formants vowel/u_fnt | |||
// before l/2 vwl_en/u_L-40+l/L2_uL | |||
endphoneme | |||
@@ -6,49 +6,43 @@ | |||
phoneme 1 // ngang tone: level | |||
stress | |||
length 11 | |||
tone 28 32 envelope/p_level NULL | |||
endphoneme | |||
phoneme 2 // huyền tone: low falling | |||
stress | |||
length 12 | |||
tone 20 8 envelope/p_fall NULL | |||
endphoneme | |||
phoneme 3 // sắc tone rising | |||
stress | |||
length 13 | |||
tone 25 50 envelope/p_rise NULL | |||
endphoneme | |||
phoneme 4 // hỏi tone curve (dipping rising) | |||
stress | |||
length 14 | |||
tone 30 5 envelope/p_fallrise NULL | |||
endphoneme | |||
phoneme 5 // ngã tone: broken (creaking rising) | |||
stress | |||
length 15 | |||
tone 30 55 envelope/p_214 envelope/vi_5amp | |||
tone 28 58 envelope/p_214 envelope/vi_5amp | |||
endphoneme | |||
phoneme 6 // nặng tone drop (constricted) | |||
stress | |||
length 16 | |||
length 75 // reduce the length of the vowel | |||
tone 40 20 envelope/p_512 envelope/vi_6amp | |||
endphoneme | |||
phoneme 7 // tone 1 (ngang) at end of clause | |||
stress | |||
length 17 | |||
tone 40 20 envelope/p_fall NULL | |||
endphoneme | |||
@@ -41,7 +41,7 @@ phonemenumber 27 _;_ // clause pause | |||
// UTILITY PHONEMES | |||
//******************************************************************* | |||
phoneme < // Start of control string | |||
phoneme < // Start of control string NOT USED | |||
pause | |||
length 0 | |||
lengthmod 1 | |||
@@ -49,42 +49,42 @@ endphoneme | |||
phoneme %% // Unstressed | |||
stress | |||
length 0 | |||
stress_type 0 | |||
endphoneme | |||
phoneme % // Diminished stress | |||
stress | |||
length 1 | |||
stress_type 1 | |||
endphoneme | |||
phoneme , // Secondary stress | |||
stress | |||
length 2 | |||
stress_type 2 | |||
endphoneme | |||
phoneme ,, // Secondary stress | |||
stress | |||
length 3 | |||
stress_type 3 | |||
endphoneme | |||
phoneme ' // Primary stress | |||
stress | |||
length 4 | |||
stress_type 4 | |||
endphoneme | |||
phoneme '' // Primary stress (priority) | |||
stress | |||
length 5 | |||
stress_type 5 | |||
endphoneme | |||
phoneme '! // Primary stress (emphasized) | |||
stress | |||
length 6 | |||
stress_type 6 | |||
endphoneme | |||
phoneme = // Place stress on previous vowel | |||
stress | |||
length 2 | |||
stress_type 2 | |||
endphoneme | |||
phoneme || // End Word | |||
@@ -1366,3 +1366,7 @@ include ph_english_klatt | |||
phonemetable ga base | |||
include ph_irish | |||
phonemetable mr hi | |||
include ph_mathari | |||
@@ -80,6 +80,8 @@ | |||
#define tPHONEMENUMBER 29 | |||
#define tPHONEMETABLE 30 | |||
#define tINCLUDE 31 | |||
#define tSTRESSTYPE 32 | |||
static const int flags_alternative[] = {phBEFOREVOWEL,phBEFOREVOWELPAUSE,phBEFORENOTVOWEL,phBEFORENOTVOWEL2,phSWITCHVOICING}; | |||
@@ -251,6 +253,7 @@ static keywtab_t keywords[] = { | |||
{"appendph",tAPPENDPH}, | |||
{"import_phoneme",tIMPORTPH}, | |||
{"beforepause",tBEFOREPAUSE}, | |||
{"stress_type",tSTRESSTYPE}, | |||
// flags | |||
{"wavef", 0x2000000+phWAVE}, | |||
@@ -880,7 +883,7 @@ int Compile::LoadWavefile(FILE *f, const char *fname) | |||
//fprintf(f_errors," sample len=%d max=%4x shift=%d\n",length,max,scale_factor); | |||
#define MIN_FACTOR 6 | |||
#define MIN_FACTOR -1 // was 6, disable use of 16 bit samples | |||
if(scale_factor > MIN_FACTOR) | |||
{ | |||
length = length/2 + (scale_factor << 16); | |||
@@ -1397,6 +1400,10 @@ int Compile::CPhoneme() | |||
ph->std_length = NextItem(tNUMBER); | |||
break; | |||
case tSTRESSTYPE: | |||
ph->std_length = NextItem(tNUMBER); | |||
break; | |||
case tWAVE: | |||
ph->phflags |= phWAVE; // drop through to tSPECT | |||
case tSPECT: | |||
@@ -1778,11 +1785,12 @@ void Compile::CPhonemeFiles() | |||
int LoadEnvelope2(FILE *f, const char *fname) | |||
{//=================================================== | |||
int ix; | |||
int ix, ix2; | |||
int n; | |||
int x, y; | |||
int displ; | |||
int n_points; | |||
double yy; | |||
char line_buf[128]; | |||
float env_x[20]; | |||
float env_y[20]; | |||
@@ -1808,11 +1816,20 @@ int LoadEnvelope2(FILE *f, const char *fname) | |||
env_y[n_points] = env_y[n_points-1]; | |||
ix = -1; | |||
ix2 = 0; | |||
for(x=0; x<ENV_LEN; x++) | |||
{ | |||
if(x > env_x[ix+4]) | |||
ix++; | |||
if(x >= env_x[ix2+1]) | |||
ix2++; | |||
if(env_lin[ix2] > 0) | |||
{ | |||
yy = env_y[ix2] + (env_y[ix2+1] - env_y[ix2]) * (float(x) - env_x[ix2]) / (env_x[ix2+1] - env_x[ix2]); | |||
y = int(yy * 2.55); | |||
} | |||
else | |||
if(n_points > 3) | |||
y = (int)(polint(&env_x[ix],&env_y[ix],4,x) * 2.55); // convert to range 0-255 | |||
else |
@@ -755,7 +755,7 @@ void Translator::CalcPitches_Tone(int clause_tone) | |||
// LANG=vi | |||
p = &phoneme_list[final_stressed]; | |||
if(p->tone_ph == 0) | |||
p->tone_ph = LookupPh("7"); // change tone 1 to falling tone at end of clause | |||
p->tone_ph = LookupPh("7"); // change default tone (tone 1) to falling tone at end of clause | |||
} | |||
@@ -278,6 +278,7 @@ void Translator::CalcLengths() | |||
int embedded_ix = 0; | |||
int min_drop; | |||
int emphasized; | |||
int tone_mod; | |||
unsigned char *pitch_env=NULL; | |||
for(ix=1; ix<n_phoneme_list; ix++) | |||
@@ -550,6 +551,15 @@ void Translator::CalcLengths() | |||
length_mod = (length_mod * len)/128; | |||
if(p->tone_ph != 0) | |||
{ | |||
if((tone_mod = phoneme_tab[p->tone_ph]->std_length) > 0) | |||
{ | |||
// a tone phoneme specifies a percentage change to the length | |||
length_mod = (length_mod * tone_mod) / 100; | |||
} | |||
} | |||
if(end_of_clause == 2) | |||
{ | |||
// this is the last syllable in the clause, lengthen it - more for short vowels |
@@ -823,6 +823,7 @@ SetLengthMods(tr,3); // all equal | |||
case L('t','a'): // Tamil | |||
case L('m','l'): // Malayalam | |||
case L('k','n'): // Kannada | |||
case L('m','r'): // Marathi | |||
{ | |||
static const short stress_lengths_ta[8] = {200, 200, 210, 210, 0, 0, 230, 230}; | |||
static const unsigned char stress_amps_ta[8] = {18,18, 18,18, 20,20, 22,22 }; | |||
@@ -835,6 +836,11 @@ SetLengthMods(tr,3); // all equal | |||
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable | |||
tr->letter_bits_offset = OFFSET_TAMIL; | |||
if(name2 == L('m','r')) | |||
{ | |||
tr->letter_bits_offset = OFFSET_DEVANAGARI; | |||
} | |||
else | |||
if(name2 == L('m','l')) | |||
{ | |||
tr->letter_bits_offset = OFFSET_MALAYALAM; | |||
@@ -915,7 +921,7 @@ SetLengthMods(tr,3); // all equal | |||
tr->letter_groups[0] = vowels_vi; | |||
tr->langopts.tone_language = 1; // Tone language, use CalcPitches_Tone() rather than CalcPitches() | |||
tr->langopts.unstressed_wd1 = 2; | |||
tr->langopts.numbers = 0x0049; | |||
tr->langopts.numbers = 0x0049 + 0x8000; | |||
} | |||
break; |
@@ -1244,7 +1244,7 @@ int Wavegen() | |||
// amplitude envelope is only used for creaky voice effect on certain vowels/tones | |||
if((ix = amp_ix>>8) > 127) ix = 127; | |||
amp = amplitude_env[ix]; | |||
amplitude2 = (amplitude2 * amp)/255; | |||
amplitude2 = (amplitude2 * amp)/128; | |||
// if(amp < 255) | |||
// modulation_type = 7; | |||
} |