Browse Source

[1.27.07] Fixed crash when espeak_Initialize() is called after espeak_Terminate()

espeakedit: setlocale(LC_NUMERIC,"C") before opening spectrum.dat file.


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

+ 1
- 1
dictsource/dict_phonemes View File

@ @- @2 @3 a a: aI aU @ @- @2 @3 a a: aI aU
e E e: E: E~ i I i: e E e: E: E~ i I i:
l- o O o: O: o~ O~ r- l- o O o: O: o~ O~ r-
U u: V
U u: u~ V


- : b c ch d d. f - : b c ch d d. f
g h H j J k kh l g h H j J k kh l

+ 1
- 1
dictsource/en_list View File

cognac k0njak cognac k0njak
coincide koUIns'aId coincide koUIns'aId
college k0lIdZ college k0lIdZ
colon koUl0n
colon koUl@n
color kVl3 color kVl3
colored kVl3d colored kVl3d
colonel k3:n@L colonel k3:n@L

+ 17
- 17
dictsource/fr_list View File

(cent une) s'A~||yn (cent une) s'A~||yn
(cent onzième) s'A~||O~zj'Em (cent onzième) s'A~||O~zj'Em
(cent onze) s'A~||O~z (cent onze) s'A~||O~z
(en haillon) A~||naj'O~
(on habille) O~||nab'ij (on habille) O~||nab'ij
(un haillon) W~||naj'O~
(mon haillon) m'O~||najO~
(son haillon) s'O~||najO~
(ton haillon) tO~||na=jO~
bus bys
echo Eko
fils fis
mars maRs
juin ZwE~
absent absA~
accident aksidA~
adéquat adekuat2 adéquat adekuat2
adéquate adekuat adéquate adekuat
adéquats adekuaz2 adéquats adekuaz2
adéquates adekuatz2 adéquates adekuatz2
pays pEi
absent absA~
ardent aRdA~ ardent aRdA~
prudent pRydA~
imprudent E~pRydA~
boeufs bY
bus bys
choeur kWr
discident disidA~ discident disidA~
accident aksidA~
echo Eko
fils fis
haillon _|ajO~
haricot _|aRiko
haricots _|aRikoz2
imprudent E~pRydA~
juin ZwE~
mars maRs
occident OksidA~ occident OksidA~
oeufs Y
orient ORjA~ orient ORjA~
pays pEi
prudent pRydA~
secret sYkRE secret sYkRE
secrets sYkREz2 secrets sYkREz2


s'y si s'y si
m'y mi m'y mi
t'y ti t'y ti
l'y li
(sud est) sydEst (sud est) sydEst
(nord est) nOREst (nord est) nOREst
écho Eko écho Eko
l'écho leko
cci $abbrev cci $abbrev
espeak ispik espeak ispik
nvda $abbrev nvda $abbrev
pourcent puRsA~ pourcent puRsA~
vincent vE~sA~ vincent vE~sA~




+ 1
- 1
dictsource/hi_list View File

ठ t.h@ ठ t.h@
ड d.@ ड d.@
ढ d.h@ ढ d.h@
ण n@ // should be n.@
ण n.@ // should be n.@
त t@ त t@
थ th@ थ th@
द d@ द d@

+ 8
- 0
dictsource/hi_rules View File



.group ऊ .group ऊ
ऊ u: ऊ u:
ऊं u~ // + anusvara
ऊँ u~ // + candrabinbu


.group ऋ .group ऋ
ऋ rI ऋ rI


.group ऐ .group ऐ
ऐ E: // ?? [aI] [E:] [&:] ऐ E: // ?? [aI] [E:] [&:]
ऐं E~
ऐँ E~
?2 ऐ aI // ?? [aI] [E:] [&:] ?2 ऐ aI // ?? [aI] [E:] [&:]






.group ू .group ू
ू u: ू u:
ूं u~
ूँ u~


.group ृ .group ृ
ृ rI ृ rI


.group ै .group ै
ै E: // ?? [aI] [E:] [&:] ै E: // ?? [aI] [E:] [&:]
ैं E~
ैँ E~
?2 ै aI // ?? [aI] [E:] [&:] ?2 ै aI // ?? [aI] [E:] [&:]


.group ॉ .group ॉ

+ 82
- 68
dictsource/hu_list View File



// Numbers // Numbers


_0 nullA
_1 EJ
_2 kEttY:
_3 ha:R2om
_4 ne:J
_5 Yt
_6 hAt
_7 he:t
_8 n^olts
_9 kilEnts
_10 ti:z
_1X tizEn
_20 hu:s
_2X huson
_3X hAR2mints
_4X nEJvEn
_5X YtvEn
_6X hAtvAn
_7X hEtvEn
_8X n^oltsvAn
_9X kilEntsvEn
_0C sa:z
_1C sa:z
_0M1 EzER2
_1M1 EzER2
_2M1 ke:tEzER2
_0M2 millio:
_1M2 millio:
_2M2 ke:tmillio:
_0M3 millia:R2d
_1M3 millia:R2d
_1M3 ke:tmillia:R2d
_0M4 billio:
_1M4 billio:
_2M4 ke:tbillio:
_dpt ||_vEss2Y:_
_0 nullA
_1 EJ
_2 kEttY:
_3 ha:R2om
_4 ne:J
_5 Yt
_6 hAt
_7 he:t
_8 n^olts
_9 kilEnts
_10 ti:z
_1X tizEn
_20 hu:s
_2X huson
_3X hAR2mints
_4X nEJvEn
_5X YtvEn
_6X hAtvAn
_7X hEtvEn
_8X n^oltsvAn
_9X kilEntsvEn
_0C sa:z
_1C sa:z
_0M1 EzER2
_1M1 EzER2
_2M1 ke:tEzER2
_0M2 millio:
_1M2 millio:
_2M2 ke:tmillio:
_0M3 millia:R2d
_1M3 millia:R2d
_2M3 ke:tmillia:R2d
_0M4 billio:
_1M4 billio:
_2M4 ke:tbillio:
_dpt ||_vEss2Y:_




// Abbreviations // Abbreviations
km kilo:me:tER2 km kilo:me:tER2
mm milime:tER2
mm milime:tER2


a.m An^n^i||m'int $dot a.m An^n^i||m'int $dot
dr doktoR2 $dot dr doktoR2 $dot
habár $pause // although habár $pause // although


ha $u $pause // if ha $u $pause // if
noha $u $pause // even thought
noha $u $pause // even thought




// Prepositions etc. // Prepositions etc.
nem $alt2 $strend nem $alt2 $strend
ne $u+ ne $u+


e $u // "-e" question
e $atend // stressed at end of sentence

// Unstressed adverbs prepositions etc. // Unstressed adverbs prepositions etc.
néhány $u+ néhány $u+
is $u // also is $u // also
közé $u közé $u
között $u között $u


an $u // so many persons
as $u
ba $u // into ba $u // into
ban $u // in
be $u be $u
ra $u // onto
re $u
ik $u // -th
as $u
es $u
os $u
ós $u
ös $u
ben $u
ból $u // from inside ból $u // from inside
ből $u ből $u
e $u // in query, his/her
ei $u // his her multiole
en $u
es $u
hez $u
hoz $u // to
höz $u
ig $u // up to
ik $u // -th
nak $u // of, him/her
nek $u
nál $u // by
nél $u
on $u // on
en $u // on
os $u
ra $u // onto
re $u
ról $u // from top of, about ról $u // from top of, about
röl $u
ről $u ről $u
án $u
én $u
on $u // on
en $u
ön $u
an $u // so many persons
ón $u
szor $u // times
szer $u szer $u
szor $u // times
szór $u
ször $u ször $u
tól $u // from
töl $u
től $u
val $u // with
vel $u
án $u // on that day
é $u // his, her
éi $u // his, her multiple
én $u
ón $u
ós $u
ön $u
ös $u


ellen $u // against ellen $u // against
elé $u // before elé $u // before
sem $u $pause // nor sem $u $pause // nor
miatt $u $pause // because miatt $u $pause // because


ban $u // in
ben $u
hoz $u // to
hez $u
höz $u
ig $u // up to
nál $u // by
nél $u
tól $u // from
től $u


be $u //into be $u //into
ki $u // out of ki $u // out of
b be: b be:
c tse: c tse:
d de: d de:
_e E
e $atend // stressed at end of sentence
f Eff f Eff
g ge: g ge:
h ha: h ha:
y ipsilon y ipsilon
z ze: z ze:


_é e:
é $atend

cs tSe: cs tSe:
dz dze: dz dze:
dzs dZe: dzs dZe:

+ 2
- 2
dictsource/hu_rules View File

zs Z zs Z
zzs Z: zzs Z:


gá) z (sz z // don't devoice [z] to [s]
gá) z (sz z
gé) z (sz z gé) z (sz z
há) z (so z há) z (so z
há) z (sz z há) z (sz z
_vá) zs (or zS _vá) zs (or zS
_szára) zs (ág zS _szára) zs (ág zS
_kö) zs (ég zS _kö) zs (ég zS
_nehé) zs (ely zS


.group .group
$ dolla:R2 $ dolla:R2

+ 6
- 4
phsource/compile_report View File

fi 40 127 fi 40 127
fr 35 118 fr 35 118
fr_ca 11 118 fr_ca 11 118
hi 49 131
hi 50 132
hu 22 112 hu 22 112
nl 26 117 nl 26 117
pl 15 107 pl 15 107
1 n^/n^_ base 1 n^/n^_ base
1 n^/n^@ base 1 n^/n^@ base
1 n^/n^#_ is 1 n^/n^#_ is
6 n/_n base ro
3 n/n_ base ro
4 n/_n base ro
2 n/n_ base ro
1 n/n@ base 1 n/n@ base
1 n/n#_ is 1 n/n#_ is
1 n^/n^a base 1 n^/n^a base
1 nn/nnu base 1 nn/nnu base
1 n^/n^o base 1 n^/n^o base
1 n/no base 1 n/no base
2 n/_nr base
1 n/nr_ base
1 n^/n^u base 1 n^/n^u base
1 n/nu base 1 n/nu base
1 r2/_r2 base 1 r2/_r2 base
1 vnasal/o_n3 fr 1 vnasal/o_n3 fr
1 vnasal/oo_n en 1 vnasal/oo_n en
2 vnasal/oo_n2 hi pl 2 vnasal/oo_n2 hi pl
1 vnasal/u_n pt
2 vnasal/u_n hi pt
3 vnasal/W_n en fr 3 vnasal/W_n en fr
1 voc/bh base 1 voc/bh base
2 voc/dh base es 2 voc/dh base es

+ 6
- 0
phsource/ph_hindi View File

endphoneme endphoneme




phoneme u~
vowel long starttype (u) endtype (u)
length 230
formants vnasal/u_n
endphoneme



phoneme r- phoneme r-
vowel starttype (@) endtype (@) vowel starttype (@) endtype (@)

+ 5
- 4
phsource/phonemes View File

phoneme n. phoneme n.
vcd rfx nasal vcd rfx nasal
starttype n endtype n starttype n endtype n
vowelout f1=2 f2=1700 -300 250 f3=-400 80 rms=20 brk colr=2
vowelin f1=2 f2=1200 -300 250 f3=-500 80 rms=20 colr=2
vowelout f1=2 f2=1200 -300 250 f3=-500 80 rms=20 brk colr=2
length 100 length 100
lengthmod 4 lengthmod 4
formants NULL formants NULL
after _ n/_n
after n n/_n // lengthen [nn]
before _ n/n_
after _ n/_nr
after n n/_nr // lengthen [nn]
before _ n/nr_
before (r) n/nj before (r) n/nj
endphoneme endphoneme



BIN
phsource/vowel/i View File


+ 45
- 0
src/extras.cpp View File

} }
#endif #endif


#define OUTPUT_MODE AUDIO_OUTPUT_PLAYBACK
#define TEXT "Hello world."
#define TEXT_SSML ("<speak>" TEXT "</speak>")
static void
speak(char *text)
{
int result;
result = espeak_Synth(text, strlen(text) + 1, 0, POS_CHARACTER, 0, espeakSSML, NULL, NULL);
assert(result == EE_OK);
}


int test4() {
espeak_ERROR result;
int sample_rate;
sample_rate = espeak_Initialize(OUTPUT_MODE, 2000, NULL, 0);
assert(sample_rate != EE_INTERNAL_ERROR);
espeak_SetSynthCallback(synth_callback);

espeak_VOICE voice;
memset(&voice, 0, sizeof(espeak_VOICE));
voice.languages = "en";
//voice.gender = 2;
voice.age = 4;

result = espeak_SetVoiceByProperties(&voice);
assert(result == EE_OK);
speak(TEXT_SSML);
speak(TEXT_SSML);
espeak_Synchronize();

#ifdef deleted
/* Now the same ting without ssml tags. */
result = espeak_SetVoiceByProperties(&voice);
assert(result == EE_OK);
speak(TEXT);
speak(TEXT);
espeak_Synchronize();
#endif
result = espeak_Terminate();
assert(result == EE_OK);

return 0;
}


char* text1 = "Hello World2. <audio src=\"here\"> Some text</audio> This is the second sentence"; char* text1 = "Hello World2. <audio src=\"here\"> Some text</audio> This is the second sentence";


//CharsetToUnicode("ISO-8859-4"); //CharsetToUnicode("ISO-8859-4");
//CharsetToUnicode("ISCII"); //CharsetToUnicode("ISCII");


test4();
return; return;


if(control==2) if(control==2)

+ 23
- 1
src/readclause.cpp View File

} // end of AddNameData } // end of AddNameData




void SetVoiceStack(espeak_VOICE *v)
{//================================
SSML_STACK *sp;
sp = &ssml_stack[0];

if(v == NULL)
{
memset(sp,0,sizeof(ssml_stack[0]));
return;
}
if(v->languages != NULL)
strcpy(sp->language,v->languages);
if(v->name != NULL)
strcpy(sp->voice_name,v->name);
sp->voice_variant = v->variant;
sp->voice_age = v->age;
sp->voice_gender = v->gender;
}


static int GetVoiceAttributes(wchar_t *pw, int tag_type) static int GetVoiceAttributes(wchar_t *pw, int tag_type)
{//===================================================== {//=====================================================
// Determines whether voice attribute are specified in this tag, and if so, whether this means // Determines whether voice attribute are specified in this tag, and if so, whether this means
return(CLAUSE_VOICE); return(CLAUSE_VOICE);


case SSML_SPEAK + SSML_CLOSE: case SSML_SPEAK + SSML_CLOSE:
terminator = CLAUSE_PARAGRAPH;
terminator = CLAUSE_PERIOD;
case SSML_VOICE + SSML_CLOSE: case SSML_VOICE + SSML_CLOSE:
// unwind stack until the previous <voice> or <speak> tag // unwind stack until the previous <voice> or <speak> tag
while((n_ssml_stack > 1) && (ssml_stack[n_ssml_stack-1].tag_type != (tag_type - SSML_CLOSE))) while((n_ssml_stack > 1) && (ssml_stack[n_ssml_stack-1].tag_type != (tag_type - SSML_CLOSE)))
option_punctuation = speech_parameters[espeakPUNCTUATION]; option_punctuation = speech_parameters[espeakPUNCTUATION];
option_capitals = speech_parameters[espeakCAPITALS]; option_capitals = speech_parameters[espeakCAPITALS];


//#ifdef deleted
pvoice = espeak_GetCurrentVoice(); pvoice = espeak_GetCurrentVoice();


ssml_sp = &ssml_stack[0]; ssml_sp = &ssml_stack[0];
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name)); strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language)); strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
} }
//#endif
current_voice_id[0] = 0; current_voice_id[0] = 0;


n_param_stack = 1; n_param_stack = 1;

+ 1
- 0
src/speak.cpp View File

#ifndef PLATFORM_WINDOWS #ifndef PLATFORM_WINDOWS
LoadConfig(); // causes problem on Windows, don't know why LoadConfig(); // causes problem on Windows, don't know why
#endif #endif
SetVoiceStack(NULL);
SynthesizeInit(); SynthesizeInit();


for(param=0; param<N_SPEECH_PARAM; param++) for(param=0; param<N_SPEECH_PARAM; param++)

+ 1
- 0
src/speak_lib.cpp View File

} }


voice_selected = NULL; voice_selected = NULL;
SetVoiceStack(NULL);
SynthesizeInit(); SynthesizeInit();
InitNamedata(); InitNamedata();



+ 1
- 0
src/speak_riscos.cpp View File



WavegenInit(22050,0); WavegenInit(22050,0);
LoadPhData(); LoadPhData();
SetVoiceStack(NULL);
SynthesizeInit(); SynthesizeInit();
return(0); return(0);
} }

+ 2
- 0
src/spectdisplay.cpp View File

} }
wxFileName path = wxFileName(filename); wxFileName path = wxFileName(filename);
leaf = path.GetName(); leaf = path.GetName();

setlocale(LC_NUMERIC,"C"); // read numbers in the form 1.23456
spectseq->Load(stream); spectseq->Load(stream);
spectseq->name = leaf; spectseq->name = leaf;
spectseq->MakePitchenv(spectseq->pitchenv); spectseq->MakePitchenv(spectseq->pitchenv);

+ 4
- 1
src/synthdata.cpp View File

#include "translate.h" #include "translate.h"
#include "wave.h" #include "wave.h"


const char *version_string = "1.27.06 07.Jul.07";
const char *version_string = "1.27.07 09.Jul.07";
const int version_phdata = 0x012701; const int version_phdata = 0x012701;


int option_device_number = -1; int option_device_number = -1;
Free(phoneme_tab_data); Free(phoneme_tab_data);
Free(phoneme_index); Free(phoneme_index);
Free(spects_data); Free(spects_data);
phoneme_tab_data=NULL;
phoneme_index=NULL;
spects_data=NULL;
} }





+ 1
- 0
src/translate.h View File

int IsDigit(unsigned int c); int IsDigit(unsigned int c);
int IsAlpha(unsigned int c); int IsAlpha(unsigned int c);
int isspace2(unsigned int c); int isspace2(unsigned int c);
void SetVoiceStack(espeak_VOICE *v);


extern FILE *f_trans; // for logging extern FILE *f_trans; // for logging

+ 14
- 2
src/voices.cpp View File

espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant) espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant)
{//================================================================ {//================================================================
// Returns a path within espeak-voices, with a possible +variant suffix // Returns a path within espeak-voices, with a possible +variant suffix
// variant is an output-only parameter
int nv; // number of candidates int nv; // number of candidates
int ix, ix2; int ix, ix2;
int j; int j;
espeak_ERROR SetVoiceByName(const char *name) espeak_ERROR SetVoiceByName(const char *name)
{//========================================= {//=========================================
espeak_VOICE *v; espeak_VOICE *v;
espeak_VOICE voice_selector;
int variant=0; int variant=0;
char *p; char *p;
char variant_name[20]; char variant_name[20];
variant = atoi(p+1); variant = atoi(p+1);
} }


memset(&voice_selector,0,sizeof(voice_selector));
voice_selector.variant = variant;
voice_selector.name = (char *)name;

// first check for a voice with this filename // first check for a voice with this filename
// This may avoid the need to call espeak_ListVoices().

if((first_voice == NULL) && (LoadVoice(buf,1) != NULL)) if((first_voice == NULL) && (LoadVoice(buf,1) != NULL))
{ {
voice_selected = first_voice; voice_selected = first_voice;
} }


WavegenSetVoice(voice); WavegenSetVoice(voice);
SetVoiceStack(&voice_selector);
return(EE_OK); return(EE_OK);
} }


{ {
voice_selected = v; voice_selected = v;
WavegenSetVoice(voice); WavegenSetVoice(voice);
SetVoiceStack(&voice_selector);
return(EE_OK); return(EE_OK);
} }
} }
return(EE_INTERNAL_ERROR); // voice name not found return(EE_INTERNAL_ERROR); // voice name not found
} // end of espeak_SetVoiceByName
} // end of SetVoiceByName








LoadVoiceVariant(voice_selected->identifier,variant); LoadVoiceVariant(voice_selected->identifier,variant);
WavegenSetVoice(voice); WavegenSetVoice(voice);
SetVoiceStack(voice_selector);

return(EE_OK); return(EE_OK);
} // end of espeak_SetVoiceByProperties
} // end of SetVoiceByProperties







Loading…
Cancel
Save