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

@@ -130,7 +130,7 @@ Dictionary hi_dict
@ @- @2 @3 a a: aI aU
e E e: E: E~ i I i:
l- o O o: O: o~ O~ r-
U u: V
U u: u~ V

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

+ 1
- 1
dictsource/en_list View File

@@ -588,7 +588,7 @@ codify koUdIfaI
cognac k0njak
coincide koUIns'aId
college k0lIdZ
colon koUl0n
colon koUl@n
color kVl3
colored kVl3d
colonel k3:n@L

+ 17
- 17
dictsource/fr_list View File

@@ -388,30 +388,31 @@ montréal mO~Real
(cent une) s'A~||yn
(cent onzième) s'A~||O~zj'Em
(cent onze) s'A~||O~z
(en haillon) A~||naj'O~
(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équate adekuat
adéquats adekuaz2
adéquates adekuatz2
pays pEi
absent absA~
ardent aRdA~
prudent pRydA~
imprudent E~pRydA~
boeufs bY
bus bys
choeur kWr
discident disidA~
accident aksidA~
echo Eko
fils fis
haillon _|ajO~
haricot _|aRiko
haricots _|aRikoz2
imprudent E~pRydA~
juin ZwE~
mars maRs
occident OksidA~
oeufs Y
orient ORjA~
pays pEi
prudent pRydA~
secret sYkRE
secrets sYkREz2

@@ -423,11 +424,9 @@ qu'y ki
s'y si
m'y mi
t'y ti
l'y li
(sud est) sydEst
(nord est) nOREst
écho Eko
l'écho leko
cci $abbrev
espeak ispik
nvda $abbrev
@@ -611,3 +610,4 @@ votions vOtjO~z2 $u
pourcent puRsA~
vincent vE~sA~



+ 1
- 1
dictsource/hi_list View File

@@ -139,7 +139,7 @@ _dpt _d@s@ml'o:_ // ?? what is Hi for "." ?
ठ t.h@
ड d.@
ढ d.h@
ण n@ // should be n.@
ण n.@ // should be n.@
त t@
थ th@
द d@

+ 8
- 0
dictsource/hi_rules View File

@@ -32,6 +32,8 @@

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

.group ऋ
ऋ rI
@@ -50,6 +52,8 @@

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


@@ -89,6 +93,8 @@

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

.group ृ
ृ rI
@@ -107,6 +113,8 @@

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

.group ॉ

+ 82
- 68
dictsource/hu_list View File

@@ -7,48 +7,48 @@

// 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
km kilo:me:tER2
mm milime:tER2
mm milime:tER2

a.m An^n^i||m'int $dot
dr doktoR2 $dot
@@ -98,7 +98,7 @@ bár $pause // although
habár $pause // although

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


// Prepositions etc.
@@ -108,9 +108,6 @@ noha $u $pause // even thought
nem $alt2 $strend
ne $u+

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

// Unstressed adverbs prepositions etc.
néhány $u+
is $u // also
@@ -145,30 +142,52 @@ közül $u
közé $u
között $u

an $u // so many persons
as $u
ba $u // into
ban $u // in
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
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
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
szor $u // times
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
elé $u // before
@@ -180,16 +199,6 @@ se $u $pause // neither
sem $u $pause // nor
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
ki $u // out of
@@ -277,6 +286,8 @@ a A: $atend // letter "a"
b be:
c tse:
d de:
_e E
e $atend // stressed at end of sentence
f Eff
g ge:
h ha:
@@ -297,6 +308,9 @@ x iks
y ipsilon
z ze:

_é e:
é $atend

cs tSe:
dz dze:
dzs dZe:

+ 2
- 2
dictsource/hu_rules View File

@@ -281,7 +281,7 @@ vörösmar) ty ti
zs Z
zzs Z:

gá) z (sz z // don't devoice [z] to [s]
gá) z (sz z
gé) z (sz z
há) z (so z
há) z (sz z
@@ -302,7 +302,7 @@ vörösmar) ty ti
_vá) zs (or zS
_szára) zs (ág zS
_kö) zs (ég zS
_nehé) zs (ely zS

.group
$ dolla:R2

+ 6
- 4
phsource/compile_report View File

@@ -15,7 +15,7 @@
fi 40 127
fr 35 118
fr_ca 11 118
hi 49 131
hi 50 132
hu 22 112
nl 26 117
pl 15 107
@@ -145,8 +145,8 @@
1 n^/n^_ base
1 n^/n^@ base
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#_ is
1 n^/n^a base
@@ -169,6 +169,8 @@
1 nn/nnu base
1 n^/n^o base
1 n/no base
2 n/_nr base
1 n/nr_ base
1 n^/n^u base
1 n/nu base
1 r2/_r2 base
@@ -381,7 +383,7 @@
1 vnasal/o_n3 fr
1 vnasal/oo_n en
2 vnasal/oo_n2 hi pl
1 vnasal/u_n pt
2 vnasal/u_n hi pt
3 vnasal/W_n en fr
1 voc/bh base
2 voc/dh base es

+ 6
- 0
phsource/ph_hindi View File

@@ -170,6 +170,12 @@ phoneme u:
endphoneme


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


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

+ 5
- 4
phsource/phonemes View File

@@ -539,13 +539,14 @@ endphoneme
phoneme n.
vcd rfx nasal
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
lengthmod 4
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
endphoneme


BIN
phsource/vowel/i View File


+ 45
- 0
src/extras.cpp View File

@@ -1164,6 +1164,50 @@ int x;
}
#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";

@@ -1181,6 +1225,7 @@ void TestTest(int control)
//CharsetToUnicode("ISO-8859-4");
//CharsetToUnicode("ISCII");

test4();
return;

if(control==2)

+ 23
- 1
src/readclause.cpp View File

@@ -921,6 +921,26 @@ int AddNameData(const char *name, int wide)
} // 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)
{//=====================================================
// Determines whether voice attribute are specified in this tag, and if so, whether this means
@@ -1367,7 +1387,7 @@ static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int &outix, int n_outb
return(CLAUSE_VOICE);

case SSML_SPEAK + SSML_CLOSE:
terminator = CLAUSE_PARAGRAPH;
terminator = CLAUSE_PERIOD;
case SSML_VOICE + SSML_CLOSE:
// 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)))
@@ -1853,6 +1873,7 @@ void InitText2(void)
option_punctuation = speech_parameters[espeakPUNCTUATION];
option_capitals = speech_parameters[espeakCAPITALS];

//#ifdef deleted
pvoice = espeak_GetCurrentVoice();

ssml_sp = &ssml_stack[0];
@@ -1865,6 +1886,7 @@ void InitText2(void)
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
}
//#endif
current_voice_id[0] = 0;

n_param_stack = 1;

+ 1
- 0
src/speak.cpp View File

@@ -288,6 +288,7 @@ static int initialise(void)
#ifndef PLATFORM_WINDOWS
LoadConfig(); // causes problem on Windows, don't know why
#endif
SetVoiceStack(NULL);
SynthesizeInit();

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

+ 1
- 0
src/speak_lib.cpp View File

@@ -349,6 +349,7 @@ static int initialise(void)
}

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


+ 1
- 0
src/speak_riscos.cpp View File

@@ -426,6 +426,7 @@ int initialise(void)

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

+ 2
- 0
src/spectdisplay.cpp View File

@@ -951,6 +951,8 @@ void MyFrame::OnNewWindow(wxCommandEvent& event)
}
wxFileName path = wxFileName(filename);
leaf = path.GetName();

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

+ 4
- 1
src/synthdata.cpp View File

@@ -35,7 +35,7 @@
#include "translate.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;

int option_device_number = -1;
@@ -160,6 +160,9 @@ void FreePhData(void)
Free(phoneme_tab_data);
Free(phoneme_index);
Free(spects_data);
phoneme_tab_data=NULL;
phoneme_index=NULL;
spects_data=NULL;
}



+ 1
- 0
src/translate.h View File

@@ -526,5 +526,6 @@ void InitText2(void);
int IsDigit(unsigned int c);
int IsAlpha(unsigned int c);
int isspace2(unsigned int c);
void SetVoiceStack(espeak_VOICE *v);

extern FILE *f_trans; // for logging

+ 14
- 2
src/voices.cpp View File

@@ -1189,6 +1189,7 @@ static espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name)
espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant)
{//================================================================
// Returns a path within espeak-voices, with a possible +variant suffix
// variant is an output-only parameter
int nv; // number of candidates
int ix, ix2;
int j;
@@ -1382,6 +1383,7 @@ void GetVoices(const char *path)
espeak_ERROR SetVoiceByName(const char *name)
{//=========================================
espeak_VOICE *v;
espeak_VOICE voice_selector;
int variant=0;
char *p;
char variant_name[20];
@@ -1395,7 +1397,13 @@ espeak_ERROR SetVoiceByName(const char *name)
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
// This may avoid the need to call espeak_ListVoices().

if((first_voice == NULL) && (LoadVoice(buf,1) != NULL))
{
voice_selected = first_voice;
@@ -1408,6 +1416,7 @@ espeak_ERROR SetVoiceByName(const char *name)
}

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

@@ -1420,11 +1429,12 @@ espeak_ERROR SetVoiceByName(const char *name)
{
voice_selected = v;
WavegenSetVoice(voice);
SetVoiceStack(&voice_selector);
return(EE_OK);
}
}
return(EE_INTERNAL_ERROR); // voice name not found
} // end of espeak_SetVoiceByName
} // end of SetVoiceByName



@@ -1436,8 +1446,10 @@ espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector)

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

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




Loading…
Cancel
Save