[1.31.06]

espeakEVENT_PHONEME, fix audio position of vowel when it follows a voiced consonant.
Ensure enough space in the event list when espeak_Initialize() is called with a small buffer size.
Tone languages: set the final stressed syllable to stress=7 so that it can be longer.
lang=zh: adjust vowels


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@136 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-02-05 17:03:06 +00:00
parent 703da28454
commit e5ada07055
11 changed files with 48 additions and 25 deletions
+5 -2
View File
@@ -59,7 +59,11 @@ language).
a4o Au51 a4o Au51
a (DnK a a (DnK a
a (DngK A ch) a (DngK A
ch) a (4ngK a
ch) a (ng4K a
k) a (DngK A
_) a (DngK A
y) a iA y) a iA
y) ao Au y) ao Au
@@ -144,7 +148,6 @@ language).
.group o .group o
o o o o
o (DngK u
ou ou ou ou
o1u ou55 o1u ou55
o2u ou35 o2u ou35
+5 -4
View File
@@ -426,9 +426,9 @@ nn/_nn [N] base
[N] zh [N] zh
nn/nn_ [N] base nn/nn_ [N] base
[N] en [N] en
[N] zh
nn/nn@ [(@)] base nn/nn@ [(@)] base
nn/nn#_ [N#] is nn/nn#_ [N#] is
nn/nn2_ [N] zh
nn/nna [(a)] base nn/nna [(a)] base
nn/nne [(e)] base nn/nne [(e)] base
nn/nni [(i)] base nn/nni [(i)] base
@@ -838,7 +838,6 @@ vdiph2/ie [i@] en_wi
[ie] fi [ie] fi
[ia] th [ia] th
[i:a] th [i:a] th
vdiph2/ie_2 [iE] zh
vdiph2/ii@ [i@] en vdiph2/ii@ [i@] en
[i@3] en [i@3] en
vdiph2/ii@_3 [i@] vi vdiph2/ii@_3 [i@] vi
@@ -1438,6 +1437,7 @@ vowel/i_6 [i:] en_us
[i] hr [i] hr
[i] id [i] id
[i] tr [i] tr
vowel/i#_6 [i.] zh
vowel/i#_7 [i[] zh vowel/i#_7 [i[] zh
vowel/i_en [i:] en vowel/i_en [i:] en
[i:] fr [i:] fr
@@ -1521,7 +1521,6 @@ vowel/o_4 [oU] en_n
vowel/o-_4 [o] ro vowel/o-_4 [o] ro
vowel/o_5 [O] nl vowel/o_5 [O] nl
vowel/o_6 [O:] nl vowel/o_6 [O:] nl
vowel/o_7 [u] zh
vowel/oe [W] en vowel/oe [W] en
[W] af [W] af
[W] de [W] de
@@ -1530,6 +1529,7 @@ vowel/oe_2 [W] no
vowel/oe_4 [W] sv vowel/oe_4 [W] sv
vowel/o_mid [O] fr vowel/o_mid [O] fr
[o] hu [o] hu
[o] zh
[o] tr [o] tr
vowel/oo [O:] en_sc vowel/oo [O:] en_sc
[O] en_wi [O] en_wi
@@ -1810,13 +1810,14 @@ vwl_ru/u#u [u"] ru
vwl_sv/r_sv3 [r] sv vwl_sv/r_sv3 [r] sv
vwl_zh/aang [aan] zhy vwl_zh/aang [aan] zhy
vwl_zh/aau [Au] zh vwl_zh/aau [Au] zh
vwl_zh/a_n [a] zh
vwl_zh/ang [ang] zhy vwl_zh/ang [ang] zhy
vwl_zh/eng [eng] zhy vwl_zh/eng [eng] zhy
vwl_zh/iaa [iA] zh vwl_zh/iaa [iA] zh
vwl_zh/iaau [iAu] zh vwl_zh/iaau [iAu] zh
vwl_zh/ie [iE] zh
vwl_zh/ing [ing] zhy vwl_zh/ing [ing] zhy
vwl_zh/iou [iou] zh vwl_zh/iou [iou] zh
vwl_zh/i_rfx [i.] zh
vwl_zh/ng [ng] zhy vwl_zh/ng [ng] zhy
vwl_zh/oeng [oen] zhy vwl_zh/oeng [oen] zhy
vwl_zh/ong [ong] zhy vwl_zh/ong [ong] zhy
+8 -6
View File
@@ -212,11 +212,11 @@ endphoneme
phoneme N //should be more different from n phoneme N //should be more different from n
vcd vel nasal vcd vel nasal
vowelout f1=3 f2=2300 300 400 f3=-200 80 len=40 rms=20 brk vowelout f1=2 f2=1900 200 400 f3=400 80 len=50 rms=15 brk
formants NULL formants NULL
before _ nn/nn_ before _ nn/nn2_
after _ nn/_nn after _ nn/_nn
lengthmod 1 lengthmod 7
after (i) nn/inn after (i) nn/inn
endphoneme endphoneme
@@ -224,6 +224,7 @@ phoneme a
vowel starttype (a) endtype (a) vowel starttype (a) endtype (a)
length 250 length 250
formants vowel/a formants vowel/a
before N vwl_zh/a_n
endphoneme endphoneme
phoneme A phoneme A
@@ -287,7 +288,8 @@ endphoneme
phoneme i. //after ts. ts.h s. z. phoneme i. //after ts. ts.h s. z.
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 250 length 250
formants vwl_zh/i_rfx // formants vwl_zh/i_rfx
formants vowel/i#_6
endphoneme endphoneme
phoneme iA //try more before N phoneme iA //try more before N
@@ -305,7 +307,7 @@ endphoneme
phoneme iE phoneme iE
vowel starttype (i) endtype (e) vowel starttype (i) endtype (e)
length 250 length 250
formants vdiph2/ie_2 formants vwl_zh/ie
endphoneme endphoneme
phoneme io phoneme io
@@ -324,6 +326,7 @@ phoneme o
vowel starttype (o) endtype (o) vowel starttype (o) endtype (o)
length 250 length 250
formants vdiph2/o_oo formants vdiph2/o_oo
before N vowel/o_mid
endphoneme endphoneme
phoneme o- phoneme o-
@@ -342,7 +345,6 @@ phoneme u //try more before N
vowel starttype (u) endtype (u) vowel starttype (u) endtype (u)
length 250 length 250
formants vowel/u_bck formants vowel/u_bck
before N vowel/o_7
endphoneme endphoneme
phoneme uA phoneme uA
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

+2 -2
View File
@@ -1880,14 +1880,14 @@ void Translator::MatchRule(char *word[], const char *group, char *rule, MatchRec
case RULE_DIGIT: case RULE_DIGIT:
if(IsDigit(letter_w)) if(IsDigit(letter_w))
{ {
match.points += (21-distance_right); match.points += (20-distance_right);
post_ptr += letter_xbytes; post_ptr += letter_xbytes;
} }
else else
if(langopts.tone_numbers) if(langopts.tone_numbers)
{ {
// also match if there is no digit // also match if there is no digit
match.points += (21-distance_right); match.points += (20-distance_right);
post_ptr--; post_ptr--;
} }
else else
+11 -3
View File
@@ -759,8 +759,14 @@ void Translator::CalcPitches_Tone(int clause_tone)
{ {
if((p->type == phVOWEL) && (p->tone >= 4)) if((p->type == phVOWEL) && (p->tone >= 4))
{ {
final_stressed = ix; if(count_stressed == 0)
count_stressed++; final_stressed = ix;
if(p->tone >= 4)
{
final_stressed = ix;
count_stressed++;
}
} }
} }
@@ -769,7 +775,6 @@ void Translator::CalcPitches_Tone(int clause_tone)
{ {
// LANG=vi // LANG=vi
p = &phoneme_list[final_stressed]; p = &phoneme_list[final_stressed];
p->tone = 7;
if(p->tone_ph == 0) 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 tone 1 to falling tone at end of clause
} }
@@ -889,6 +894,9 @@ void Translator::CalcPitches_Tone(int clause_tone)
p->pitch2 = pitch_adjust + phoneme_tab[tone_ph]->end_type; p->pitch2 = pitch_adjust + phoneme_tab[tone_ph]->end_type;
} }
} }
phoneme_list[final_stressed].tone = 7;
} // end of Translator::CalcPitches_Tone } // end of Translator::CalcPitches_Tone
+3 -2
View File
@@ -698,8 +698,9 @@ ENTER("espeak_Initialize");
if((out_start = outbuf) == NULL) if((out_start = outbuf) == NULL)
return(EE_INTERNAL_ERROR); return(EE_INTERNAL_ERROR);
// allocate space for event list. Allow 200 events per second // allocate space for event list. Allow 200 events per second.
n_event_list = (buf_length*200)/1000; // Add a constant to allow for very small buf_length
n_event_list = (buf_length*200)/1000 + 20;
if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL) if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL)
return(EE_INTERNAL_ERROR); return(EE_INTERNAL_ERROR);
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h" #include "translate.h"
#include "wave.h" #include "wave.h"
const char *version_string = "1.31.05 04.Feb.08"; const char *version_string = "1.31.06 05.Feb.08";
const int version_phdata = 0x013105; const int version_phdata = 0x013105;
int option_device_number = -1; int option_device_number = -1;
+12 -4
View File
@@ -1097,6 +1097,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
unsigned char *amp_env; unsigned char *amp_env;
PHONEME_TAB *ph; PHONEME_TAB *ph;
PHONEME_TAB *prev_ph; PHONEME_TAB *prev_ph;
static int sourceix=0;
#ifdef TEST_MBROLA #ifdef TEST_MBROLA
if(mbrola_name[0] != 0) if(mbrola_name[0] != 0)
@@ -1140,15 +1141,16 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(p->newword) if(p->newword)
{ {
last_frame = NULL; last_frame = NULL;
sourceix = (p->sourceix & 0x7ff) + clause_start_char;
if(p->newword & 4) if(p->newword & 4)
DoMarker(espeakEVENT_SENTENCE, (p->sourceix & 0x7ff) + clause_start_char, 0, count_sentences); // start of sentence DoMarker(espeakEVENT_SENTENCE, sourceix, 0, count_sentences); // start of sentence
// if(p->newword & 2) // if(p->newword & 2)
// DoMarker(espeakEVENT_END, count_characters, 0, count_sentences); // end of clause // DoMarker(espeakEVENT_END, count_characters, 0, count_sentences); // end of clause
if(p->newword & 1) if(p->newword & 1)
DoMarker(espeakEVENT_WORD, (p->sourceix & 0x7ff) + clause_start_char, p->sourceix >> 11, clause_start_word + word_count++); DoMarker(espeakEVENT_WORD, sourceix, p->sourceix >> 11, clause_start_word + word_count++);
} }
EndAmplitude(); EndAmplitude();
@@ -1156,9 +1158,10 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(p->prepause > 0) if(p->prepause > 0)
DoPause(p->prepause); DoPause(p->prepause);
if(option_phoneme_events) if(option_phoneme_events && (p->type != phVOWEL))
{ {
DoMarker(espeakEVENT_PHONEME, (p->sourceix & 0x7ff) + clause_start_char, 0, p->ph->mnemonic); // Note, for vowels, do the phoneme event after the vowel-start
DoMarker(espeakEVENT_PHONEME, sourceix, 0, p->ph->mnemonic);
} }
switch(p->type) switch(p->type)
@@ -1398,6 +1401,11 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
DoSpect(ph,prev->ph,next->ph,1,p,modulation); DoSpect(ph,prev->ph,next->ph,1,p,modulation);
} }
if(option_phoneme_events)
{
DoMarker(espeakEVENT_PHONEME, sourceix, 0, p->ph->mnemonic);
}
DoSpect(p->ph,prev->ph,next->ph,2,p,modulation); DoSpect(p->ph,prev->ph,next->ph,2,p,modulation);
memset(vowel_transition,0,sizeof(vowel_transition)); memset(vowel_transition,0,sizeof(vowel_transition));
+1 -1
View File
@@ -718,7 +718,7 @@ SetLengthMods(tr,3); // all equal
case L('z','h'): case L('z','h'):
case L_zhy: case L_zhy:
{ {
static const short stress_lengths_zh[8] = {230,150, 230,230, 230,0, 230,250}; static const short stress_lengths_zh[8] = {230,150, 230,230, 230,0, 230,300};
static const unsigned char stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 }; static const unsigned char stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 };
tr = new Translator; tr = new Translator;