Browse Source

Lang=fr change to phonemes [o] [O] [A~] [O~] [R]

Added new phonemes [s.] and [z.] (as common phonemes), use in Lang=ru, Lang=sv, Lang=hi
Remake WAV files for [s;] and [z;] phonemes.
espeak_Terminate(), set pointers to NULL after free().
espeak_Initialize(), returns EE_INTERNAL_ERROR (-1) if fails to allocate memory.
Change to the default tone setting (array: tone_points in voices.cpp).


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

+ 1
- 1
dictsource/hi_list View File

@@ -156,7 +156,7 @@ _dpt _d@s@ml'o:_ // ?? what is Hi for "." ?
ऱ r@
व v@
श S@
S@ // should be retroflex [S]
s.@ // should be retroflex [S]
स s@
ह H@
क़ q@

+ 3
- 3
dictsource/hi_rules View File

@@ -347,9 +347,9 @@
?1 श (_ S

.group ष
SV //?? or retroflex [S]
ष (B S //??
?1 ष (_ S //??
s.V //?? or retroflex [S]
ष (B s. //??
?1 ष (_ s. //??

.group स
स sV

+ 5
- 5
dictsource/ru_list View File

@@ -18,7 +18,7 @@ _2 dv'A
_3 t;r'i
_4 ts;It'yr;I
_5 p;'jat;
_6 S'Es;t;
_6 s.'Es;t;
_7 s;'em
_8 v'os;E2m
_9 d;'ev;It;
@@ -28,7 +28,7 @@ _12 dv;In'AttsVt;
_13 tr;In'AttsVt;
_14 ts;It'y@-*nVttsVt;
_15 p;Itn'AttsVt;
_16 SE#stn'AttsVt;
_16 s.E#stn'AttsVt;
_17 s;Imn'AttsVt;
_18 vOs;Imn'AttsVt;
_19 d;E2v;Itn'AttsVt;
@@ -36,7 +36,7 @@ _2X dv'AttsVt;
_3X tr;'ittsVt;
_4X s'o@-*Ok
_5X p;Id;d;Is;'jat
_6X SE2z;d;d;Is;'jat
_6X s.E2z;d;d;Is;'jat
_7X s;'emd;E2s;It
_8X v'os;E2md;E2s;It
_9X d;E2v;In'ostO
@@ -45,7 +45,7 @@ _2C dv;'es;t;I
_3C tr;'ista
_4C ts;It'yr;E2sta
_5C p;,It;s'ot
_6C S,E#s;t;s'ot
_6C s.,E#s;t;s'ot
_7C s;,Ims'ot
_8C vOs;Ims'ot
_9C d;E2v;It;s'ot
@@ -82,7 +82,7 @@ _dpt2 _d;Is;'atYx // end of decimal fraction


// questions
что Sto $u $pause // what, that
что s.to $u $pause // what, that


// misc.

+ 50
- 46
dictsource/ru_rules View File

@@ -177,25 +177,25 @@


.group ж
_) ж (_ ZE
ж (кY S
ж (кь S
ж (пY S
ж (пь S
ж (сь S
ж (сY S
ж (ть S
ж (тY S
ж (фь S
ж (фY S
ж (ффь S
ж (ффY S
ж (хь S
ж (хY S
ж (хкY S
ж (хкь S
ж Z
_) ж (_ z.E
ж (кY s.
ж (кь s.
ж (пY s.
ж (пь s.
ж (сь s.
ж (сY s.
ж (ть s.
ж (тY s.
ж (фь s.
ж (фY s.
ж (ффь s.
ж (ффY s.
ж (хь s.
ж (хY s.
ж (хкY s.
ж (хкь s.
ж z.

.group з
_) з (_ zE
@@ -243,8 +243,8 @@
з (сь s;
з (сY s;

з (ж Z
з (ш S
з (ж z.
з (ш s.
з (щ s;s;
з (ч s;s;
з z
@@ -329,6 +329,10 @@

.group о
о o
о (B oj
о (Cь oj
о (FY oj


.group п
_) п (_ pE
@@ -396,10 +400,10 @@
с (дY z;
с (дB z;

с (ж Z
с (ш S
с (щ s;s;
с (ч s;s;
с (ж z.
с (ш s.
с (щ s;
с (ч s;

с s

@@ -430,7 +434,7 @@

т (ж d

т t
т t

.group у
_) у (_ u
@@ -546,27 +550,27 @@


.group ш
_) ш (_ SA
ш (б Z
ш (бь Z
ш (бY Z
ш (бмь Z
ш (бмY Z
ш (бвь Z
ш (бвY Z
ш (г Z
ш (гь Z
ш (гY Z
ш (д Z
ш (дь Z
ш (дY Z
ш (дB Z
ш (ж Z
ш (з Z
ш (зь Z
ш (зY Z
_) ш (_ s.A
ш (б z.
ш (бь z.
ш (бY z.
ш (бмь z.
ш (бмY z.
ш (бвь z.
ш (бвY z.
ш (г z.
ш (гь z.
ш (гY z.
ш (д z.
ш (дь z.
ш (дY z.
ш (дB z.
ш (ж z.
ш (з z.
ш (зь z.
ш (зY z.
ш S
ш s.

.group щ
_) щ (_ S;ja

+ 3
- 3
dictsource/sv_rules View File

@@ -243,11 +243,11 @@ espeak _^_EN
.group r
r r
r) r
rs S
rs s.
rsi (o rsx'
rsk Sk
rsk s.k
rsk (i rsx
rss S
rss s.
rg (_ rj
radera rad'e:ra


+ 2
- 2
dictsource/vi_rules View File

@@ -1,4 +1,4 @@
.group a
a a:
ai a:I
@@ -387,7 +387,7 @@
qu kw

.group r
r D
r z;

.group s
s s

+ 48
- 45
phsource/compile_report View File

@@ -1,38 +1,38 @@
33 phoneme tables
new total
base 89 89
en 52 136
en_n 29 136
en_us 36 136
en_sc 39 138
en_rp 34 136
en_wm 30 136
af 37 120
cy 30 115
de 28 112
eo 15 101
fi 40 120
fr 32 113
fr_ca 11 113
hi 50 125
hu 24 106
nl 25 109
pl 17 100
sk 22 115
cs 6 116
hr 15 119
ru 35 116
it 28 109
es 7 109
pt 25 124
pt_pt 17 124
ro 36 133
el 7 109
sv 25 111
no 29 115
vi 41 126
zh_yue 32 117
sw 14 98
base 91 91
en 52 138
en_n 29 138
en_us 36 138
en_sc 39 140
en_rp 34 138
en_wm 30 138
af 37 122
cy 30 117
de 28 114
eo 15 103
fi 40 122
fr 32 115
fr_ca 11 115
hi 50 127
hu 24 108
nl 25 111
pl 17 102
sk 22 117
cs 6 118
hr 15 121
ru 36 119
it 28 111
es 7 111
pt 25 126
pt_pt 17 126
ro 36 135
el 7 111
sv 25 113
no 29 117
vi 41 128
zh_yue 32 119
sw 14 100

3 b/b base hi ro
2 b/b_ base hi
@@ -216,7 +216,9 @@
1 ufric/sh_ base
2 ufric/sh_pzd base ro
3 ufric/sh_pzd_ base
5 ufric/s_pzd base ro
2 ufric/sh_rfx base
3 ufric/s_pzd base ro
2 ufric/s_pzd_ base
1 ufric/sx_sv sv
1 ufric/th base
1 ufric/th_ base
@@ -343,8 +345,8 @@
1 vdiph/y#y fi
2 vdiph/y#y_2 af zh_yue
1 vdiph/y#y_3 nl
2 vnasal/aa_n en fr
1 vnasal/aa_n3 af
1 vnasal/aa_n en
2 vnasal/aa_n3 af fr
2 vnasal/ee_n en fr_ca
3 vnasal/ee_n2 hi pl pt_pt
2 vnasal/e_n af pt
@@ -356,7 +358,8 @@
1 vnasal/oi_n pt
2 vnasal/o_n hi pt
1 vnasal/o_n2 af
2 vnasal/oo_n en fr
1 vnasal/o_n3 fr
1 vnasal/oo_n en
2 vnasal/oo_n2 hi pl
1 vnasal/&u_n pt
1 vnasal/u_n pt
@@ -375,18 +378,18 @@
1 vocw/Q2 nl
6 vocw/v base ro
4 vocw/zh base ro
1 vocw/zh_rfx cs
3 vocw/zh_rfx base cs
3 voc/z base fr ro
3 voc/z_ base fr ro
2 voc/zh base ro
2 voc/zh_ base ro
3 voc/zh base ro
3 voc/zh_ base ro
1 voc/zh_2 cs
2 voc/z_pzd base
2 voc/z_pzd_ base
14 vowel/@ base en en_us en_rp cy hi hr
1 vowel/@- base
4 vowel/& en_rp fi hi sv
5 vowel/0 en fr hi it pt
4 vowel/0 en hi it pt
4 vowel/0_2 en_n en_wm pt_pt sw
5 vowel/0_3 en_us en_sc en_rp hu
1 vowel/@_2 fr
@@ -402,7 +405,7 @@
5 vowel/a_2 eo it pt_pt ro vi
3 vowel/a#_2 hr sv sw
5 vowel/a_3 en_sc cs
11 vowel/a#_3 en en_n en_us en_wm de hi pt_pt vi zh_yue
12 vowel/a#_3 en en_n en_us en_wm de hi ru pt_pt vi zh_yue
4 vowel/a_4 en_wm el vi
2 vowel/a_5 sv sw
7 vowel/aa en_us fi fr_ca no zh_yue
@@ -445,13 +448,13 @@
2 vowel/ii_4 en_rp
6 vowel/ii_en en en_n
5 vowel/@_low hi ro no
9 vowel/o en en_wm de fr hi it pt_pt sv
8 vowel/o en en_wm de hi it pt_pt sv
4 vowel/o_2 cy hi hu no
2 vowel/o-_2 en_n en_wm
2 vowel/o_3 en_sc
1 vowel/o-_3 en_rp
1 vowel/o_4 en_n
1 vowel/o_6 nl
2 vowel/o_4 en_n fr
2 vowel/o_6 fr nl
4 vowel/oe en af de fr
1 vowel/oe_2 no
1 vowel/oe_4 sv

+ 6
- 6
phsource/ph_french View File

@@ -50,14 +50,14 @@ endphoneme
phoneme o
vowel starttype (o) endtype (o)
length 166
formants vowel/o
formants vowel/o_4
endphoneme


phoneme O
vowel starttype (o) endtype (o)
length 190
formants vowel/0
formants vowel/o_6
endphoneme


@@ -102,7 +102,7 @@ endphoneme
phoneme A~
vowel starttype (a) endtype (a)
length 222
formants vnasal/aa_n
formants vnasal/aa_n3
endphoneme


@@ -116,7 +116,7 @@ endphoneme
phoneme O~
vowel starttype (o) endtype (o)
length 222
formants vnasal/oo_n
formants vnasal/o_n3
endphoneme


@@ -188,7 +188,6 @@ phoneme R
length 100
lengthmod 7
beforenotvowel r/
trill
formants vwl_fr/@R+r3/rx%80
endphoneme

@@ -240,7 +239,7 @@ endphoneme
phoneme z2 // silent unless followed by vowel
beforenotvowel NULL
vcd alv frc sibilant
vowelout f1=0 f2=1700 -300 300 f3=-100 60 len=50
vowelout f1=0 f2=1700 -300 300 f3=-100 60 len=50
formants voc/z+ufric/s_
before _ voc/z_+ufric/s_
lengthmod 6
@@ -277,3 +276,4 @@ endphoneme





+ 6
- 0
phsource/ph_russian View File

@@ -278,4 +278,10 @@ phoneme a
length 100
endphoneme

phoneme a#
vowel starttype (a) endtype (a)
formants vowel/a#_3
length 100
endphoneme



+ 27
- 4
phsource/phonemes View File

@@ -774,12 +774,23 @@ phoneme Z
endphoneme


phoneme z.
vcd pla frc sibilant
vowelin f1=0 f2=1800 -100 300 f3=-300 80
vowelout f1=2 f2=1800 -100 300 f3=-300 80 brk
formants voc/zh+vocw/zh_rfx
before _ voc/zh_+vocw/zh_rfx
lengthmod 6
switchvoicing s.
endphoneme


phoneme z;
vcd pal frc sibilant palatal
vowelin f1=2 f2=2700 400 600 f3=300 80 rate len=70
vowelout f1=2 f2=2300 250 300 f3=-300 80 brk
formants voc/z_pzd+ufric/s_pzd%40
before _ voc/z_pzd_+ufric/s_pzd%40
formants voc/z_pzd+ufric/s_pzd%80
before _ voc/z_pzd_+ufric/s_pzd_%80
lengthmod 6
switchvoicing s;
endphoneme
@@ -994,12 +1005,24 @@ phoneme s;
vowelout f1=1 f2=2700 400 600 f3=200 70 rate len=70
length 100
lengthmod 3
wave ufric/s_pzd%50
before _ ufric/s_pzd%50
wave ufric/s_pzd
before _ ufric/s_pzd_
switchvoicing z;
endphoneme


phoneme s.
vls pla frc sibilant
vowelin f1=0 f2=1800 -100 300 f3=-300 80
vowelout f1=0 f2=1800 -100 300 f3=-300 80
length 100
lengthmod 3
wave ufric/sh_rfx%80
before _ ufric/sh_rfx%60
switchvoicing z.
endphoneme


phoneme S;
vls pal frc sibilant palatal
vowelin f1=1 f2=2700 400 600 f3=200 70 rate len=70

BIN
phsource/ufric/s_pzd.wav View File


BIN
phsource/ufric/s_pzd_.wav View File


BIN
phsource/ufric/sh_rfx.wav View File


BIN
phsource/vnasal/o_n3 View File


BIN
phsource/vnasal/oo_n View File


BIN
phsource/vnasal/vowelchart.png View File


BIN
phsource/vowel/V View File


BIN
phsource/vowel/V_2 View File


BIN
phsource/vwl_fr/@R View File


+ 2
- 2
src/dictionary.cpp View File

@@ -1098,9 +1098,9 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int

if((langopts.stress_flags & 0x1000) && (vowel_stress[1] == 0))
{
if((vowel_count == 3) && (vowel_stress[2] >= 4))
// If there is only one syllable before the primary stress, give it a secondary stress
if((vowel_count > 2) && (vowel_stress[2] >= 4))
{
// 2-syllable word, put a secondary stress on the initial syllable
vowel_stress[1] = 3;
}
}

+ 1
- 1
src/intonation.cpp View File

@@ -267,7 +267,7 @@ static TONE_TABLE tone_table[N_TONE_TABLE] = {
{PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question
20, 25, 34, 20, drops_0, 3, 3, 15, 25, 0},

{PITCHdrop, 40, 2, PITCHdrop, 42,25, // exclamation
{PITCHdrop, 38, 1, PITCHdrop, 42,25, // exclamation
20, 25, 34, 22, drops_0, 3, 3, 12, 8, 0},



+ 5
- 2
src/readclause.cpp View File

@@ -1841,8 +1841,11 @@ void InitText2(void)
ssml_sp->voice_variant = 0;
ssml_sp->voice_gender = 0;
ssml_sp->voice_age = 0;
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
if(pvoice != NULL)
{
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
}
current_voice_id[0] = 0;

n_param_stack = 1;

+ 6
- 2
src/speak_lib.cpp View File

@@ -646,11 +646,13 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
buf_length = 200;
outbuf_size = (buf_length * samplerate)/500;
outbuf = (unsigned char*)realloc(outbuf,outbuf_size);
out_start = outbuf;
if((out_start = outbuf) == NULL)
return(EE_INTERNAL_ERROR);

// allocate space for event list. Allow 500 events per minute
n_event_list = (buf_length*500)/1000;
event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list);
if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL)
return(EE_INTERNAL_ERROR);

option_phonemes = 0;

@@ -1050,7 +1052,9 @@ ESPEAK_API espeak_ERROR espeak_Terminate(void)

#endif
Free(event_list);
event_list = NULL;
Free(outbuf);
outbuf = NULL;
FreePhData();

return EE_OK;

+ 1
- 1
src/speak_lib.h View File

@@ -145,7 +145,7 @@ int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *pat

path: The directory which contains the espeak-data directory, or NULL for the default location.

Returns: sample rate in Hz
Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR).
*/

typedef int (t_espeak_callback)(short*, int, espeak_EVENT*);

+ 1234
- 0
src/speak_riscos.cpp
File diff suppressed because it is too large
View File


+ 1
- 1
src/synthdata.cpp View File

@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"

const char *version_string = "1.24.03 06.May.07";
const char *version_string = "1.24.04 08.May.07";
const int version_phdata = 0x012201;

int option_device_number = -1;

+ 2
- 2
src/tr_languages.cpp View File

@@ -224,13 +224,13 @@ Translator *SelectTranslator(const char *name)

case L('f','r'): // french
{
static int stress_lengths_fr[8] = {180, 180, 180, 180, 0, 0, 220, 220};
static int stress_lengths_fr[8] = {180, 160, 180, 190, 0, 0, 220, 220};
static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 };

tr = new Translator();
SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
tr->langopts.stress_rule = 3; // stress on final syllable
tr->langopts.stress_flags = 0x20; // don't use secondary stress
tr->langopts.stress_flags = 0x0024; // don't use secondary stress
tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables

tr->langopts.numbers = 0x1509;

+ 1
- 1
src/translate.h View File

@@ -254,7 +254,7 @@ typedef struct {
// bit6=light syllable followed by heavy, move secondary stress to the heavy syllable. LANG=Finnish
// bit8=stress last syllable if it doesn't end in a vowel
// bit9=stress last syllable if it doesn't end in vowel or "s" or "n" LANG=Spanish
// bit12= In 2-syllable words, give the first syllable a secondary stress
// bit12= If there is only one syllable before the primary stress, give it a secondary stress

int stress_flags;
int unstressed_wd1; // stress for $u word of 1 syllable

+ 10
- 6
src/voices.cpp View File

@@ -47,6 +47,9 @@ MNEM_TAB genders [] = {
{"female", 2},
{NULL, 0 }};

//int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0};
int tone_points[10] = {600,180, 1200,140, 2000,110, 3000,110, -1,0};

// limit the rate of change for each formant number
//static int formant_rate_22050[9] = {50, 104, 165, 230, 220, 220, 220, 220, 220}; // values for 22kHz sample rate
static int formant_rate_22050[9] = {50, 100, 165, 200, 200, 200, 200, 200, 200}; // values for 22kHz sample rate
@@ -155,7 +158,6 @@ const char variants_female[N_VOICE_VARIANTS] = {11,12,13,14,0};
const char *variant_lists[3] = {variants_either, variants_male, variants_female};


int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0};

void SetToneAdjust(voice_t *voice, int *tone_pts)
{//==============================================
@@ -544,11 +546,6 @@ voice_t *LoadVoice(char *vname, int control)
}

f_voice = fopen(buf,"r");
if(first_voice == NULL)
{
first_voice = ReadVoiceFile(f_voice,buf+len_path_voices,voicename);
rewind(f_voice);
}

language_type = "en"; // default
if(f_voice == NULL)
@@ -560,6 +557,13 @@ voice_t *LoadVoice(char *vname, int control)
language_type = voicename;
}

if(first_voice == NULL)
{
first_voice = ReadVoiceFile(f_voice,buf+strlen(path_voices),voicename);
rewind(f_voice);
}


if(!tone_only && (translator != NULL))
{
delete translator;

Loading…
Cancel
Save