Browse Source

[1.29.07] Reduce clicks at very low pitches due to numerical overflow in wave generation.

Treat echo-delay = 0 as "no echo", even if ech-amplitude is set.
lang=ru, fix crash for "words" which has produce no phonemes (wg. ":").


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@88 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 18 years ago
parent
commit
ca61663045

+ 1
- 1
dictsource/cs_rules View File

ie (_ ije ie (_ ije
ii (_ iji ii (_ iji
io (_ ijo io (_ ijo
iu (_ ijo
iu (_ iju
_) i (on j _) i (on j


C) ight ajt // right, night C) ight ajt // right, night

+ 1
- 0
dictsource/en_list View File

has %ha2z $pastf $only has %ha2z $pastf $only
has haz $only $atend has haz $only $atend
(has been) %haz%bIn $pastf (has been) %haz%bIn $pastf
(has to) haztU $atend
hath %haT $pastf $only hath %haT $pastf $only
had %had $pastf $strend2 $only had %had $pastf $strend2 $only
(had been) %had%bIn $pastf (had been) %had%bIn $pastf

+ 3
- 0
dictsource/hu_rules View File

_kö) zs (ég zS _kö) zs (ég zS
_nehé) zs (ely zS _nehé) zs (ely zS


_) zürich tsyR2iC


.group .group
$ dolla:R2 $ dolla:R2
ä E ä E

+ 39
- 40
phsource/compile_report View File

38 phoneme tables
39 phoneme tables
new total new total
base 96 96 base 96 96
base2 23 114 base2 23 114
en 53 144 en 53 144
en_n 29 144
en_n 30 144
en_us 37 144 en_us 37 144
en_sc 39 146 en_sc 39 146
en_rp 34 144 en_rp 34 144
vi 42 134 vi 42 134
zhy 40 129 zhy 40 129
sw 14 105 sw 14 105
en_x 33 144


3 b/b base hi ro 3 b/b base hi ro
2 b/b_ base hi 2 b/b_ base hi
1 l^/j2u base 1 l^/j2u base
1 l^/_l^ base 1 l^/_l^ base
1 l^/l^ base 1 l^/l^ base
9 l/l base en af hu sk ru la pt ro
11 l/_l base en af de hu sk ru la pt ro
10 l/l base en af hu sk ru la pt ro en_x
12 l/_l base en af de hu sk ru la pt ro en_x
1 l/l_ base 1 l/l_ base
2 l/l@ base 2 l/l@ base
1 l/L1_aL base 1 l/L1_aL base
4 l/l_long base fr la ro 4 l/l_long base fr la ro
2 l/lo base 2 l/lo base
2 l/lu base 2 l/lu base
9 l/tl base en af hu sk ru la pt ro
10 l/tl base en af hu sk ru la pt ro en_x
6 l/xl base 6 l/xl base
3 m/_m base ru ro 3 m/_m base ru ro
3 m/m_ base ru ro 3 m/m_ base ru ro
2 ustop/ts_pzd_ hi hu 2 ustop/ts_pzd_ hi hu
2 ustop/ts_pzd2 hi hu 2 ustop/ts_pzd2 hi hu
2 vdiph/0i pt vi 2 vdiph/0i pt vi
2 vdiph/0i_2 en_sc no
2 vdiph2/e@ en_sc
3 vdiph/0i_2 en_sc no en_x
3 vdiph2/e@ en_sc en_x
1 vdiph2/ea ro 1 vdiph2/ea ro
1 vdiph2/eo ro 1 vdiph2/eo ro
1 vdiph2/e[u ro 1 vdiph2/e[u ro
1 vdiph2/i@ en_n 1 vdiph2/i@ en_n
1 vdiph2/i@_2 en_wm 1 vdiph2/i@_2 en_wm
1 vdiph2/ie fi
2 vdiph2/ie fi en_x
1 vdiph2/ii@ en 1 vdiph2/ii@ en
1 vdiph2/ii@_3 vi 1 vdiph2/ii@_3 vi
3 vdiph2/iu base2 vi zhy 3 vdiph2/iu base2 vi zhy
1 vdiph2/iy fi 1 vdiph2/iy fi
1 vdiph2/o@ af 1 vdiph2/o@ af
1 vdiph2/oa ro 1 vdiph2/oa ro
1 vdiph2/o_oo is
2 vdiph2/o_oo is en_x
1 vdiph2/u-@ vi 1 vdiph2/u-@ vi
1 vdiph2/u#@ en_sc 1 vdiph2/u#@ en_sc
1 vdiph2/uo fi 1 vdiph2/uo fi
4 vdiph2/uu@ en en_n en_wm vi
5 vdiph2/uu@ en en_n en_wm vi en_x
1 vdiph2/y#@ af 1 vdiph2/y#@ af
1 vdiph2/yu nl 1 vdiph2/yu nl
1 vdiph2/y-y# fi 1 vdiph2/y-y# fi
2 vdiph/aai_2 af cy 2 vdiph/aai_2 af cy
1 vdiph/aai_3 fi 1 vdiph/aai_3 fi
1 vdiph/aau fi 1 vdiph/aau fi
4 vdiph/aau_2 de nl la zhy
5 vdiph/aau_2 de nl la zhy en_x
1 vdiph/aau_3 hi 1 vdiph/aau_3 hi
1 vdiph/aau_4 vi 1 vdiph/aau_4 vi
1 vdiph/ae fr_ca 1 vdiph/ae fr_ca
1 vdiph/ae_2 en_n 1 vdiph/ae_2 en_n
7 vdiph/ai base2 eo sk hr it pt vi
8 vdiph/ai base2 eo sk hr it pt vi en_x
2 vdiph/ai_2 cy 2 vdiph/ai_2 cy
1 vdiph/ai_3 no 1 vdiph/ai_3 no
1 vdiph/ai_4 af 1 vdiph/ai_4 af
4 vowel/0_2 en_n en_wm pt_pt sw 4 vowel/0_2 en_n en_wm pt_pt sw
4 vowel/0_3 en_us en_sc en_rp hu 4 vowel/0_3 en_us en_sc en_rp hu
2 vowel/@_2 fr 2 vowel/@_2 fr
2 vowel/&_2 en_us
6 vowel/@_3 en_sc de hi 6 vowel/@_3 en_sc de hi
1 vowel/3_2 en_n 1 vowel/3_2 en_n
1 vowel/3_3 en_rp 1 vowel/3_3 en_rp
1 vowel/@_4 nl 1 vowel/@_4 nl
2 vowel/8_2 en_us sv 2 vowel/8_2 en_us sv
1 vowel/8_3 zhy 1 vowel/8_3 zhy
14 vowel/a en_n cy de hu nl pl sk hr sr it la
4 vowel/a# base2 en_sc pt
7 vowel/a_2 base2 eo la pt pt_pt ro vi
16 vowel/a en_n en_wm cy de hu nl pl sk hr sr it la
5 vowel/a# base2 en_sc pt en_x
11 vowel/a_2 base2 eo la pt pt_pt ro vi en_x
4 vowel/a#_2 hr sv is sw 4 vowel/a#_2 hr sv is sw
7 vowel/a_3 en_sc fr cs is 7 vowel/a_3 en_sc fr cs is
12 vowel/a#_3 en en_n en_us en_wm de hi ru pt_pt vi zhy 12 vowel/a#_3 en en_n en_us en_wm de hi ru pt_pt vi zhy
4 vowel/a_4 en_wm el vi
2 vowel/a_4 el vi
3 vowel/a_5 it sv sw 3 vowel/a_5 it sv sw
5 vowel/aa fi fr_ca no zhy 5 vowel/aa fi fr_ca no zhy
1 vowel/aa# fi 1 vowel/aa# fi
2 vowel/aa_8 en_us 2 vowel/aa_8 en_us
3 vowel/a_en en fr 3 vowel/a_en en fr
1 vowel/@_bck hi 1 vowel/@_bck hi
14 vowel/e base2 en en_n af cy eo fr hr it la pt pt_pt ++
15 vowel/e base2 en en_n af cy eo fr hr it la pt pt_pt ++
2 vowel/e# en_sc 2 vowel/e# en_sc
7 vowel/e_2 en_sc de hi it sv no 7 vowel/e_2 en_sc de hi it sv no
1 vowel/e_3 hu 1 vowel/e_3 hu
1 vowel/e_5 en_sc 1 vowel/e_5 en_sc
3 vowel/ee fr pl sv 3 vowel/ee fr pl sv
2 vowel/e_e en_sc is 2 vowel/e_e en_sc is
8 vowel/ee_1 base2 en en_n pl la sv no zhy
3 vowel/ee_2 en cy nl
9 vowel/ee_1 base2 en en_n en_wm pl la sv no zhy
4 vowel/ee_2 en en_us cy nl
1 vowel/ee#_2 sv 1 vowel/ee#_2 sv
4 vowel/ee_3 af pt vi 4 vowel/ee_3 af pt vi
3 vowel/ee_6 en_n sk sv 3 vowel/ee_6 en_n sk sv
13 vowel/e_mid en_rp en_wm fr_ca hi hu sk cs hr it es pt_pt no ++
13 vowel/e_mid en_rp fr_ca hi hu sk cs hr it es pt_pt no is ++
10 vowel/e_mid2 af de fi nl sk ro el sw 10 vowel/e_mid2 af de fi nl sk ro el sw
1 vowel/@_fnt hr
3 vowel/@_fnt hr en_x
1 vowel/@_hgh no 1 vowel/@_hgh no
18 vowel/i base2 en_n en_rp en_wm cy eo fr hu pl it pt pt_pt ++
18 vowel/i base2 en_n en_wm cy eo fr hu pl it pt pt_pt ro ++
2 vowel/i# en_rp cy 2 vowel/i# en_rp cy
5 vowel/i_2 de nl la sv
6 vowel/i_2 en_rp de nl la sv
3 vowel/i_3 af fr sk 3 vowel/i_3 af fr sk
4 vowel/i_4 fi hu it is 4 vowel/i_4 fi hu it is
5 vowel/i_5 en_sc 5 vowel/i_5 en_sc
3 vowel/i#_5 pt_pt ro 3 vowel/i#_5 pt_pt ro
1 vowel/i_6 hr 1 vowel/i_6 hr
3 vowel/i_en en en_us vi 3 vowel/i_en en en_us vi
2 vowel/i_fnt hi
3 vowel/i_fnt hi en_x
12 vowel/ii en_rp en_wm cy de fr_ca nl is zhy 12 vowel/ii en_rp en_wm cy de fr_ca nl is zhy
3 vowel/ii# cy pl ru 3 vowel/ii# cy pl ru
1 vowel/ii_2 la 1 vowel/ii_2 la
6 vowel/ii_3 fi hi sk hr sv no
7 vowel/ii_3 fi hi sk hr sv no en_x
5 vowel/ii_4 en en_n 5 vowel/ii_4 en en_n
2 vowel/ii_5 en_x
2 vowel/ii_6 en_wm 2 vowel/ii_6 en_wm
1 vowel/ii_en en 1 vowel/ii_en en
10 vowel/@_low en_rp hi ro no 10 vowel/@_low en_rp hi ro no
11 vowel/o base2 en en_wm de hi it la pt_pt sv
12 vowel/o base2 en en_wm de hi it la pt_pt sv en_x
4 vowel/o_2 cy hi hu no 4 vowel/o_2 cy hi hu no
2 vowel/o-_2 en_n en_wm 2 vowel/o-_2 en_n en_wm
3 vowel/o_3 en_sc fr 3 vowel/o_3 en_sc fr
1 vowel/oe_2 no 1 vowel/oe_2 no
1 vowel/oe_4 sv 1 vowel/oe_4 sv
2 vowel/o_mid fr hu 2 vowel/o_mid fr hu
9 vowel/oo en_sc de eo la es el sv no zhy
11 vowel/oo_1 en_n en_rp en_wm af fi sk hr vi
12 vowel/oo en_sc de eo la es el sv no zhy en_x
10 vowel/oo_1 en_n en_rp en_wm af fi sk hr vi
3 vowel/oo_2 en_sc cy cs 3 vowel/oo_2 en_sc cy cs
1 vowel/oo_3 af 1 vowel/oo_3 af
3 vowel/oo_4 hi pl it
6 vowel/oo_4 hi pl it en_x
1 vowel/oo_5 is 1 vowel/oo_5 is
6 vowel/oo_en en en_n en_rp 6 vowel/oo_en en en_n en_rp
2 vowelr/aa_r en_sc 2 vowelr/aa_r en_sc
4 vowelr/r-voc hi sk hr 4 vowelr/r-voc hi sk hr
2 vowelr/V3_r en en_sc 2 vowelr/V3_r en en_sc
1 vowelr/V_r en 1 vowelr/V_r en
6 vowel/u cy de eo fr cs la
7 vowel/u cy de eo fr cs la en_x
5 vowel/u# en en_sc 5 vowel/u# en en_sc
5 vowel/u_2 fi fr sk hr ro 5 vowel/u_2 fi fr sk hr ro
1 vowel/u#_2 sv 1 vowel/u#_2 sv
3 vowel/uu_2 base2 de la 3 vowel/uu_2 base2 de la
1 vowel/uu_3 af 1 vowel/uu_3 af
2 vowel/uu_4 fi sv 2 vowel/uu_4 fi sv
8 vowel/uu_bck en_n fr_ca hi hu pt no zhy
9 vowel/uu_bck en_n fr_ca hi hu pt no zhy en_x
1 vowel/V en_sc 1 vowel/V en_sc
4 vowel/V_2 en af ru
5 vowel/V_2 en en_us af ru
3 vowel/V_3 en_rp hi vi 3 vowel/V_3 en_rp hi vi
1 vowel/V_4 en_sc 1 vowel/V_4 en_sc
6 vowel/y en de fi hu nl zhy 6 vowel/y en de fi hu nl zhy
1 vwl_af/@ af 1 vwl_af/@ af
1 vwl_af/I af 1 vwl_af/I af
2 vwl_af/r@ af 2 vwl_af/r@ af
6 vwl_en/aI@ en en_n en_us en_sc en_rp en_wm
7 vwl_en/aI@ en en_n en_us en_sc en_rp en_wm en_x
2 vwl_en/aI@_2 en_sc 2 vwl_en/aI@_2 en_sc
5 vwl_en/aU@ en en_n en_us en_sc en_wm
6 vwl_en/aU@ en en_n en_us en_sc en_wm en_x
12 vwl_en/@L en en_us en_sc en_rp en_wm af 12 vwl_en/@L en en_us en_sc en_rp en_wm af
3 vwl_en/@L_2 en_sc 3 vwl_en/@L_2 en_sc
1 vwl_en_n/aa_5 en_n 1 vwl_en_n/aa_5 en_n
1 vwl_en_n/O@ en_n
2 vwl_en_n/O@ en_n
1 vwl_en_n/u_ en_n 1 vwl_en_n/u_ en_n
3 vwl_en_rp/aa en_rp 3 vwl_en_rp/aa en_rp
1 vwl_en_rp/aU@ en_rp 1 vwl_en_rp/aU@ en_rp
1 vwl_en/u en 1 vwl_en/u en
4 vwl_en/u_L en en_n en_us en_rp 4 vwl_en/u_L en en_n en_us en_rp
2 vwl_en_us/3_us en_us 2 vwl_en_us/3_us en_us
2 vwl_en_us/a en_us
1 vwl_en_us/aai en_us 1 vwl_en_us/aai en_us
2 vwl_en_us/ar en_us 2 vwl_en_us/ar en_us
1 vwl_en_us/ee en_us
1 vwl_en_us/er en_us 1 vwl_en_us/er en_us
1 vwl_en_us/i_final3 en_us 1 vwl_en_us/i_final3 en_us
2 vwl_en_us/ii en_us 2 vwl_en_us/ii en_us
1 vwl_en_us/oor en_us 1 vwl_en_us/oor en_us
3 vwl_en_us/or en_us en_sc 3 vwl_en_us/or en_us en_sc
1 vwl_en_us/ur en_us 1 vwl_en_us/ur en_us
1 vwl_en_us/V en_us
1 vwl_en_wm/i en_wm 1 vwl_en_wm/i en_wm
2 vwl_fr/@R fr pt_pt
3 vwl_fr/@R fr pt_pt
1 vwl_fr/@R2 fr_ca 1 vwl_fr/@R2 fr_ca
1 vwl_fr/rfr fr
1 vwl_hi/A hi 1 vwl_hi/A hi
3 vwl_hi/l-voc hi sk 3 vwl_hi/l-voc hi sk
2 vwl_no/& no 2 vwl_no/& no

+ 2
- 2
phsource/ph_english_n View File

phoneme O@ phoneme O@
vowel starttype (o) endtype (@) vowel starttype (o) endtype (@)
length 240 length 240
formants vowel/oo_1
formants vwl_en_n/O@
linkout r- linkout r-
endphoneme endphoneme




phoneme O@
phoneme o@
vowel starttype (o) endtype (@) vowel starttype (o) endtype (@)
length 240 length 240
formants vwl_en_n/O@ formants vwl_en_n/O@

+ 1
- 1
phsource/ph_english_rp View File

phoneme i: phoneme i:
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 175 length 175
formants vowel/i
formants vowel/i_2
after w w/wi2 after w w/wi2
linkout ; linkout ;
endphoneme endphoneme

+ 8
- 6
phsource/ph_english_us View File



phoneme a phoneme a
vowel starttype (a) endtype (@) vowel starttype (a) endtype (@)
length 190
formants vwl_en_us/a
length 180
formants vowel/&_2
// 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 190
formants vwl_en_us/a
formants vowel/&_2
// formants vwl_en_us/a
linkout r- linkout r-
endphoneme endphoneme


phoneme E phoneme E
vowel starttype (e) endtype (e) vowel starttype (e) endtype (e)
length 160 length 160
formants vwl_en_us/ee
formants vowel/ee_2
reduceto I 0 reduceto I 0
endphoneme endphoneme


phoneme V phoneme V
vowel starttype (a) endtype (@) vowel starttype (a) endtype (@)
length 170 length 170
formants vwl_en_us/V
// formants vowel/V_2
// formants vwl_en_us/V
formants vowel/V_2
reduceto @ 0 reduceto @ 0
endphoneme endphoneme



+ 4
- 4
phsource/ph_english_wm View File

phoneme a phoneme a
vowel starttype (a) endtype (a) vowel starttype (a) endtype (a)
length 170 length 170
formants vowel/a_4
formants vowel/a
reduceto a2 0 reduceto a2 0
endphoneme endphoneme


phoneme E phoneme E
vowel starttype (e) endtype (e) vowel starttype (e) endtype (e)
length 150 length 150
formants vowel/e_mid
formants vowel/ee_1
reduceto I 0 reduceto I 0
// before l/ DFT-30+L/eL_af
endphoneme endphoneme




vowel starttype (u) endtype (u) vowel starttype (u) endtype (u)
length 150 length 150
formants vowel/uu formants vowel/uu
linkout _|
endphoneme endphoneme




phoneme aa // 'bath' etc. phoneme aa // 'bath' etc.
vowel starttype (a) endtype (a) vowel starttype (a) endtype (a)
length 150 length 150
formants vowel/a_4
formants vowel/a
linkout r- linkout r-
endphoneme endphoneme



+ 4
- 1
phsource/phonemes View File



phoneme d phoneme d
vcd alv stop vcd alv stop
vowelin f1=2 f2=1700 -300 300 f3=-100 80
vowelin f1=1 f2=1700 -300 300 f3=-100 80
vowelout f1=2 f2=1700 -300 300 f3=-100 80 vowelout f1=2 f2=1700 -300 300 f3=-100 80
formants d/d+x/d formants d/d+x/d
before _ d/d_+x/d_ before _ d/d_+x/d_
//phonemetable f_en basef //phonemetable f_en basef
//include pf_english //include pf_english


phonemetable en_x en
include ph_english_x




BIN
phsource/vdiph2/ie View File


BIN
phsource/vdiph2/o_oo View File


BIN
phsource/vdiph2/vowelchart.png View File


BIN
phsource/vowel/&_2 View File


BIN
phsource/vowel/3_2 View File


BIN
phsource/vowel/V_2 View File


BIN
phsource/vowel/ee# View File


BIN
phsource/vowel/i_2 View File


BIN
phsource/vowel/ii_5 View File


BIN
phsource/vowel/o View File


BIN
phsource/vowel/u View File


BIN
phsource/vowel/uu View File


BIN
phsource/vowel/vowelchart.png View File


+ 1
- 48
src/dictionary.cpp View File

int ix; int ix;
int v; int v;
int v_stress; int v_stress;
int reduce_level;
int stressed_syllable; // position of stressed syllable int stressed_syllable; // position of stressed syllable
int max_stress_posn; int max_stress_posn;
int unstressed_word = 0; int unstressed_word = 0;
if(phonetic[ix] == 0) if(phonetic[ix] == 0)
break; break;
} }
if(ix == 0) return;
final_ph = phonetic[ix-1]; final_ph = phonetic[ix-1];


max_output = output + (N_WORD_PHONEMES-3); /* check for overrun */ max_output = output + (N_WORD_PHONEMES-3); /* check for overrun */
if(v_stress > 0) if(v_stress > 0)
*output++ = stress_phonemes[v_stress]; // mark stress of all vowels except 0 (unstressed) *output++ = stress_phonemes[v_stress]; // mark stress of all vowels except 0 (unstressed)


while((ph->reduce_to != 0) && (((dictionary_flags & FLAG_FOUND)==0) || (langopts.param[LOPT_REDUCE] & 1)))
{
// this vowel can be reduced to another if the stress is below a specified value
int reduce = 0;

switch(reduce_level = (ph->phflags >> 28) & 7)
{
case 0:
/* reduce unstressed-diminished to schwa */
if((vowel_stress[v+1] <= 1) && (v >= (vowel_count-2)))
{
/* not if followed by another, terminating, unstessed syllable */
break;
} // drop through to next case
case 1:
if(v_stress == 1) // diminished stress only
reduce = 1;
break;

default:
if(v_stress < reduce_level)
reduce = 1;
break;
}

if(max_stress == 1) max_stress = 0;
if(unstressed_word && (langopts.param[LOPT_REDUCE] & 0x2) && (v_stress >= max_stress))
{
// don't reduce the most stressed syllable in an unstressed word
reduce = 0;
}

if(reduce)
{
phcode = ph->reduce_to;
ph = phoneme_tab[phcode];
#ifdef deleted
if(*p == phonLENGTHEN)
{
/* delete length indicator after vowel now that it has been reduced */
p++;
}
#endif
}
else
break;
}


if(vowel_stress[v] > max_stress) if(vowel_stress[v] > max_stress)
{ {

+ 50
- 18
src/phonemelist.cpp View File

int Translator::ChangePhonemes(PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch) int Translator::ChangePhonemes(PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch)
{//====================================================================================================== {//======================================================================================================
// Called for each phoneme in the phoneme list, to allow a language to make changes // Called for each phoneme in the phoneme list, to allow a language to make changes
// flags: bit 0=1 last phoneme in a word
// bit 1=1 this is the highest stressed vowel in the current word
// bit 2=1 after the highest stressed vowel in the current word
// bit 3=1 the phonemes were specified explicitly, or found from an entry in the xx_list dictionary
// ph The current phoneme // ph The current phoneme
return(0); return(0);
} }
PHONEME_TAB *ph; PHONEME_TAB *ph;
PHONEME_TAB *prev, *next, *next2; PHONEME_TAB *prev, *next, *next2;
int unstress_count = 0; int unstress_count = 0;
int word_has_stress = 0;
int word_stress = 0;
int switched_language = 0; int switched_language = 0;
int max_stress; int max_stress;
int voicing; int voicing;
} }


if(plist2->sourceix) if(plist2->sourceix)
word_has_stress = 0; // start of a word
{
// start of a word
int k;
word_stress = 0;

// find the highest stress level in this word
for(k=j+1; k < n_ph_list2; k++)
{
if(ph_list3[k].sourceix)
break; // start of the next word

if(ph_list3[k].stress > word_stress)
word_stress = ph_list3[k].stress;
}
}


if(ph == NULL) continue; if(ph == NULL) continue;


{ {
// in a sequence of unstressed syllables, reduce alternate syllables to 'diminished' // in a sequence of unstressed syllables, reduce alternate syllables to 'diminished'
// stress. But not for the last phoneme of a stressed word // stress. But not for the last phoneme of a stressed word
if((langopts.stress_flags & 0x2) || (word_has_stress && ((plist2+1)->sourceix!=0)))
if((langopts.stress_flags & 0x2) || ((word_stress > 3) && ((plist2+1)->sourceix!=0)))
{ {
// An unstressed final vowel of a stressed word // An unstressed final vowel of a stressed word
unstress_count=1; // try again for next syllable unstress_count=1; // try again for next syllable
else else
{ {
unstress_count = 0; unstress_count = 0;
if(plist2->stress > 3)
word_has_stress = 1; // word has a primary or a secondary stress
} }
} }


} }
} }


if((ph->reduce_to != 0) && (ph->type != phVOWEL) && !(plist2->synthflags & SFLAG_DICTIONARY))

while((ph->reduce_to != 0) && (!(plist2->synthflags & SFLAG_DICTIONARY) || (langopts.param[LOPT_REDUCE] & 1)))
{ {
// reduction for vowels has already been done in SetWordStress
int reduce_level; int reduce_level;
int stress_level;
int reduce = 0;

reduce_level = (ph->phflags >> 28) & 7;


if(next->type == phVOWEL)
if(ph->type == phVOWEL)
{ {
reduce_level = (ph->phflags >> 28) & 7;
if((&plist2[1])->stress < reduce_level)
{
// look at the stress of the following vowel
ph = phoneme_tab[ph->reduce_to];
}
stress_level = plist2->stress;
}
else
{
// consonant, get stress from the following vowel
if(next->type == phVOWEL)
stress_level = (plist2+1)->stress;
else
break;
}

if(stress_level == 1)
reduce = 1; // stress = 'reduced'

if(stress_level < reduce_level)
reduce =1;

if((word_stress < 4) && (langopts.param[LOPT_REDUCE] & 0x2) && (stress_level >= word_stress))
{
// don't reduce the most stressed syllable in an unstressed word
reduce = 0;
} }

if(reduce)
ph = phoneme_tab[ph->reduce_to];
else
break;
} }


if((plist2+1)->synthflags & SFLAG_LENGTHEN) if((plist2+1)->synthflags & SFLAG_LENGTHEN)

+ 0
- 5
src/tr_languages.cpp View File

int Translator_Russian::ChangePhonemes(PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch) int Translator_Russian::ChangePhonemes(PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch)
{//============================================================================================================== {//==============================================================================================================
// Called for each phoneme in the phoneme list, to allow a language to make changes // Called for each phoneme in the phoneme list, to allow a language to make changes
// flags: bit 0=1 last phoneme in a word
// bit 1=1 this is the highest stressed vowel in the current word
// bit 2=1 after the highest stressed vowel in the current word
// bit 3=1 the phonemes were specified explicitly, or found from an entry in the xx_list dictionary
// bits 8-15 syllable number, 1=first syllable, etc.
// ph The current phoneme // ph The current phoneme


int variant; int variant;

+ 1
- 1
src/translate.cpp View File

if(last_char == 'f') if(last_char == 'f')
TranslateRules(&word_ss[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0); TranslateRules(&word_ss[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0);
else else
if(strchr_w("hsx",last_char)==NULL)
if((last_char==0) || (strchr_w("hsx",last_char)==NULL))
TranslateRules(&word_zz[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0); TranslateRules(&word_zz[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0);
else else
TranslateRules(&word_iz[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0); TranslateRules(&word_iz[1], phonemes, N_WORD_PHONEMES, NULL, 0, 0);

+ 4
- 4
src/voices.cpp View File

// Set parameters for a formant // Set parameters for a formant
int ix; int ix;
int formant; int formant;
int freq = -1;
int height = -1;
int width = -1;
int freq = 100;
int height = 100;
int width = 100;


ix = sscanf(p,"%d %d %d %d",&formant,&freq,&height,&width); ix = sscanf(p,"%d %d %d %d",&formant,&freq,&height,&width);
if(ix < 2) if(ix < 2)
{ {
while(isspace(*p)) p++; while(isspace(*p)) p++;
n = -1; n = -1;
if((n = atoi(p)) > 0)
if(((n = atoi(p)) > 0) && (n < 32))
{ {
p++; p++;
conditional_rules |= (1 << n); conditional_rules |= (1 << n);

+ 7
- 4
src/wavegen.cpp View File

amp = embedded_value[EMBED_H]; amp = embedded_value[EMBED_H];
delay = 130; delay = 130;
} }

if(delay == 0)
amp = 0;
echo_head = (delay * samplerate)/1000; echo_head = (delay * samplerate)/1000;
echo_amp = amp; echo_amp = amp;
// compensate (partially) for increase in amplitude due to echo // compensate (partially) for increase in amplitude due to echo
{ {
peak_harmonic[pk] = peaks[pk].freq / pitch; peak_harmonic[pk] = peaks[pk].freq / pitch;
x = peaks[pk].height >> 14; x = peaks[pk].height >> 14;
peak_height[pk] = x * x * 5;
peak_height[pk] = (x * x * 5)/2;


// only use harmonics up to half the samplerate // only use harmonics up to half the samplerate
if(peak_harmonic[pk] >= hmax_samplerate) if(peak_harmonic[pk] >= hmax_samplerate)
for(h=0; h<=hmax; h++, f+=pitch) for(h=0; h<=hmax; h++, f+=pitch)
{ {
x = htab[h] >> 15; x = htab[h] >> 15;
htab[h] = (x * x) >> 7;
htab[h] = (x * x) >> 8;


if((ix = (f >> 19)) < N_TONE_ADJUST) if((ix = (f >> 19)) < N_TONE_ADJUST)
{ {
maxh2 = PeaksToHarmspect(peaks,pitch<<4,hspect[0],0); maxh2 = PeaksToHarmspect(peaks,pitch<<4,hspect[0],0);


// adjust amplitude to compensate for fewer harmonics at higher pitch // adjust amplitude to compensate for fewer harmonics at higher pitch
amplitude2 = (amplitude * pitch)/(100 << 12);
amplitude2 = (amplitude * pitch)/(100 << 11);


// switch sign of harmonics above about 900Hz, to reduce max peak amplitude // switch sign of harmonics above about 900Hz, to reduce max peak amplitude
h_switch_sign = 890 / (pitch >> 12); h_switch_sign = 890 / (pitch >> 12);
cycle_count++; cycle_count++;


// adjust amplitude to compensate for fewer harmonics at higher pitch // adjust amplitude to compensate for fewer harmonics at higher pitch
amplitude2 = (amplitude * pitch)/(100 << 12);
amplitude2 = (amplitude * pitch)/(100 << 11);


if(glottal_flag > 0) if(glottal_flag > 0)
{ {

Loading…
Cancel
Save