Added language: "bs" Bosnian. Fix to speak_lib.h for Windows dll version. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@69 d46cf337-b52f-0410-862d-fd96e6ae7743master
@@ -143,8 +143,8 @@ Dictionary hr_dict | |||
& @ @- @2 a A a: aI | |||
aU E e e: E~ i I i: | |||
l- o o: oU r- u U u: | |||
y | |||
l- O o o: oU r- u U | |||
u: y | |||
* b d dZ dZ; f g h | |||
j k l l^ m n N n^ | |||
@@ -336,19 +336,6 @@ h j k l m n N p | |||
r R s t w z | |||
Dictionary sr_dict | |||
& @ @- @2 a A a: aI | |||
aU E e e: E~ i I i: | |||
l- o o: oU r- u U u: | |||
y | |||
* b d dZ dZ; f g h | |||
j k l l^ m n N n^ | |||
p r R s S t tS ts | |||
tS; v x z Z | |||
Dictionary mk_dict | |||
& @ @- @2 a A a: E |
@@ -835,31 +835,32 @@ famine famIn | |||
farewell $2 | |||
fasten faas@n | |||
fathom faD@m | |||
favorite feIv@-rIt // sp. | |||
favorite feIv@-rIt // sp. | |||
favourite feIv@-rIt | |||
favorites feIv@-rIts // sp. | |||
favorites feIv@-rIts // sp. | |||
favourites feIv@-rIts | |||
feisty faIstI2 | |||
feline fi:laIn | |||
feminine fEm@nIn | |||
fete feIt | |||
fetus fi:t@s | |||
fi f,aI // as in "hi-fi" | |||
fi f,aI // as in "hi-fi" | |||
fiasco fi:'askoU | |||
fiery faI@rI2 | |||
finale fIn'A:lI2 | |||
finance faInans $only | |||
finance $verb | |||
finess fI2nEs // for finessed | |||
finesse fI2nEs | |||
finite faInaIt | |||
fishnet fISnEt | |||
fiord fi:O@d | |||
fix fIks // for fixer | |||
fix fIks // for fixer | |||
flagellum fla2dZEl@m | |||
flexible flEksIb@L | |||
flier flaI3 | |||
flourish flVrI2S | |||
focus foUk@s // ed,ing | |||
focus foUk@s // ed,ing | |||
foothold fUthoUld | |||
forage f0rIdZ | |||
force fo@s | |||
@@ -870,11 +871,11 @@ forestall fo@st'O:l | |||
foretell fo@t'El | |||
forever $2 | |||
forewarn $2 | |||
formid fO@m'Id // formidable | |||
formid fO@m'Id // formidable | |||
foyer fOIeI | |||
freelance fri:laans | |||
frigate frIg@t | |||
fringer frIndZ3 // infringer | |||
fringer frIndZ3 // infringer | |||
fringing frIndZIN | |||
frontend fr'Vnt,End | |||
frontpage fr'Vntp,eIdZ | |||
@@ -916,7 +917,7 @@ gourmet gU@meI | |||
graduate gradju:@t | |||
graduate gradju:eIt $verb | |||
graffiti gra2fi:tI2 | |||
gredient gri:di@nt // ingredient | |||
gredient gri:di@nt // ingredient | |||
grenade gr@neId | |||
grosvenor groUv@n3 | |||
groupie gru:pI | |||
@@ -1011,7 +1012,7 @@ inference Inf@r@ns | |||
influenza Influ:'Enz@ | |||
infrastructure $1 | |||
ingenuity IndZIn'ju:I2tI2 | |||
inherit I2nhErIt // inherited | |||
inherit I2nhErIt // inherited | |||
innard In3d | |||
inner In3 | |||
inning InIN | |||
@@ -1020,7 +1021,7 @@ insert Ins3:t $onlys | |||
insert Ins'3:t $verb | |||
insightful $2 | |||
inspire Insp'aI@ | |||
instal I2nstO:l // instalment | |||
instal I2nstO:l // instalment | |||
installation Inst@l'eIS@n | |||
instinctive $2 | |||
insult $2 | |||
@@ -1032,12 +1033,12 @@ intern Int3:n | |||
interrogatory $3 | |||
inventory Inv@ntrI2 | |||
interface $1 | |||
intermin I2nt3:mIn // interminable | |||
intermin I2nt3:mIn // interminable | |||
internet Int3nEt | |||
interrupt $1 $onlys | |||
interrupt $3 $verb | |||
interval Int3v@L | |||
interven Int3v'i:n // for intervening | |||
interven Int3v'i:n // for intervening | |||
intro $1 | |||
iris aIrIs | |||
irony aIr@nI2 | |||
@@ -2252,7 +2253,6 @@ Pandora $2 | |||
Penelope p@nEl@pI2 | |||
Phoebe fi:bi: | |||
Rachel reItS@L | |||
Reilly raIlI2 | |||
Rica ri:ka2 | |||
Robert r0b3t | |||
Roderick r0drIk |
@@ -1604,9 +1604,8 @@ | |||
.group e | |||
e E | |||
&) e (_ | |||
e (_ =@ | |||
_C) e (_ i: | |||
_CC) e (_ i: | |||
_C) e (_N i: | |||
_CC) e (_N i: | |||
_C) e (Be_ i: | |||
_CC) e (Be_ i: | |||
_CCC) e (Be_ i: | |||
@@ -2109,6 +2108,7 @@ | |||
_C) er 3: | |||
_h) er (A Er | |||
_CC) er 3: | |||
_CC) er (A Er | |||
_qu) er 3: | |||
c) er (am I2r | |||
&) ere (_ 3 | |||
@@ -2132,7 +2132,6 @@ | |||
c) ere (mon ErI2 | |||
h) er (en i@r | |||
st) ereo ErI2oU | |||
_st) er (A Er | |||
m) er (ge '3: | |||
erging '3:dZI2N | |||
v) er (ge '3: | |||
@@ -2686,7 +2685,8 @@ | |||
ied (_$2i d // suffix | |||
ie (c aI | |||
ie (ce i: | |||
_C) ie (_ aI | |||
ie (_ aI | |||
&) ie (_ I2 | |||
_r) ie i: | |||
iedly IdlI2 | |||
_z) ie i: | |||
@@ -2714,7 +2714,7 @@ | |||
cl) ie (nt aI@ | |||
&) ier (y I2@r | |||
ier i@ | |||
ier (_ i@ | |||
&) ier (_S2i @ | |||
_h) ie (r aI@ | |||
pl) ier (_ aI@ | |||
_Cr) ier aI@ | |||
@@ -2736,7 +2736,7 @@ | |||
ser) ies (_ i:z | |||
_ar) ies (_ i:z | |||
iesc I2Es | |||
&) ie (st_ I2@ | |||
&) iest (_S3i @st | |||
pr) ie (st i: | |||
_v) ie (t %i@ | |||
ie (ve i: | |||
@@ -4245,6 +4245,7 @@ | |||
regim rEdZIm | |||
re (gist rE | |||
_) re (i@P2 r,i: | |||
_) rei (l raI | |||
_) rele (g rElI2 | |||
rele (nt rI2lE | |||
rele (v rElI |
@@ -281,6 +281,8 @@ _a a | |||
a a $atend | |||
_o o | |||
o o $atend | |||
v uve | |||
x Ekis | |||
_y ,ig@-*'iEQa | |||
y ,ig@-*'iEQa $atend | |||
@@ -93,7 +93,7 @@ | |||
.group ू | |||
ू u: | |||
ूं u~ | |||
ूं u~ // or O~ ?? | |||
ूँ u~ | |||
.group ृ | |||
@@ -312,7 +312,7 @@ | |||
्) य (_ j@3 | |||
.group र | |||
र rV | |||
र r@2 | |||
र (B r | |||
?1 र (_ r | |||
्) र (_ r@- |
@@ -38,10 +38,12 @@ _?A slovo // unknown letter | |||
% p'osto | |||
+ plus | |||
€ 'euRo | |||
?2 € 'ev@-*o | |||
@ _'at | |||
& _'end | |||
! 'usklItSnIk | |||
: dv'ototSk& | |||
?2 : dv'otatSk& | |||
# b@-*'oj_ | |||
/ k@-*'oz_ | |||
\\ b'EkslES | |||
@@ -52,10 +54,12 @@ _?A slovo // unknown letter | |||
µ m'ik@-*o | |||
¶ tSl'an&k | |||
° st'up&n^ | |||
?2 ° st'epen | |||
_" n'avodnIk | |||
_‚ 'otvoReni||n'avodnIk | |||
_„ sp'uSteni||n'avodnIk | |||
… t@-*'i||t'otSke | |||
?2 … t@-*'i||t'atSke | |||
† k@-*'iZ | |||
‡ dv'ost@-*Uki||k@-*'iZ | |||
‰ p@-*'omil | |||
@@ -65,6 +69,7 @@ _’ j'ednost@-*'uki||n'avodnIk | |||
_“ 'otvoReni||n'avodnIk | |||
_” z'atvoReni||n'avodnIk | |||
• k@-*'upna||t'otSk& | |||
?2 • k@-*'upna||t'atSk& | |||
_– En||ts'r-t& | |||
_— Em||ts'r-t& | |||
™ p@-*'o'izvodZ&tS | |||
@@ -93,6 +98,8 @@ _, z'aRez | |||
_- ts'r-t'its& | |||
_. t'otSk& | |||
_; t'otSk&z,a*Ez | |||
?2 _. t'atSk& | |||
?2 _; t'atSk&z,a*Ez | |||
_< m'an^i||'od | |||
_= j'edn&ko | |||
_> v'etSi||'od | |||
@@ -145,14 +152,22 @@ _6C S'Est'o | |||
_0M1 t'isUtS;& | |||
_0MA1 t'isUtS;e | |||
_1M1 t'isUtS;U | |||
?2 _0M1 h'il^ad& | |||
?2 _0MA1 h'il^ade | |||
?2 _1M1 h'il^adU | |||
_0M2 m'ilijUna | |||
_0MA2 m'ilijUna | |||
_1M2 m'ilijUn | |||
?2 _0M2 m'ilijOna | |||
?2 _0MA2 m'ilijOna | |||
?2 _1M2 m'ilijOn | |||
_0M3 m'iliardI | |||
_0MA3 m'iliarde | |||
_1M3 m'iliardU | |||
_0M4 b'ilijUna | |||
_1M4 b'ilijUn | |||
?2 _0M4 b'ilijOna | |||
?2 _1M4 b'ilijOn | |||
_dpt _:z'a*Ez_ | |||
@@ -450,6 +465,7 @@ tzv $dot | |||
// Demonstratives | |||
tko $u+ | |||
?2 šta $u+ | |||
što $u+ | |||
koga $pause | |||
čega $pause |
@@ -1,6 +1,10 @@ | |||
// translation rules for Croatian | |||
// This file is UTF-8 encoded | |||
// Conditional rules: | |||
// ?1 Croatian | |||
// ?2 Bosnian (Bosna and Hercegovina) | |||
.group a | |||
a a | |||
a (j A | |||
@@ -136,6 +140,7 @@ | |||
$ d'ol&R | |||
. totSk& | |||
?2 . tatSk& | |||
. (. _: | |||
\.) . | |||
@@ -210,9 +210,20 @@ | |||
eu (s eU | |||
e (uCK e | |||
j) e (tA_ E | |||
j) e (tAm_ E | |||
j) e (tAs_ E | |||
?1 d) e (CAA y | |||
?1 d) e (CACAA y | |||
?1 d) e (CACAC y | |||
?1 d) e (CACC y | |||
?1 d) e (CCAA y | |||
?1 d) e (nCAA ,e | |||
?1 d) e (CCACA y | |||
?1 d) e (nCACA ,e | |||
?1 d) e (CCACCA y | |||
?1 d) e (nCACCA ,e | |||
j) e (tA_ E | |||
j) e (tAm_ E | |||
j) e (tAs_ E | |||
?1 _) es (C@@ S // drop initial "e". | |||
?1 _) e (f i // efectuar, etc. | |||
@@ -233,7 +244,7 @@ | |||
?1 _f) e (ch y // fechar | |||
?1 _p) e (rcentag y // percentagem | |||
?1 p) e (ssoa y //pessoal, pessoais, etc. | |||
?1 pr) e (cis y // precisar | |||
?1 pr) e (cis y // precisar | |||
?1 pr) e (f y // preferências, etc. | |||
?1 _r) e (cicl y // recicla, reciclagem, etc... | |||
?1 r) e (cor y // recorrer, recordar | |||
@@ -717,3 +728,4 @@ | |||
@@ -13,7 +13,7 @@ | |||
de 32 123 | |||
eo 13 108 | |||
fi 40 127 | |||
fr 35 118 | |||
fr 34 118 | |||
fr_ca 11 118 | |||
hi 50 132 | |||
hu 23 112 | |||
@@ -36,10 +36,10 @@ | |||
no 28 122 | |||
is 32 121 | |||
vi 41 133 | |||
zhy 32 124 | |||
zhy 33 125 | |||
sw 14 105 | |||
4 b/b base fr hi ro | |||
3 b/b base hi ro | |||
2 b/b_ base hi | |||
2 b/b@ base hi | |||
2 b/b@2 base hi | |||
@@ -456,10 +456,10 @@ | |||
10 vowel/e_mid2 af de fi nl sk ro el sw | |||
2 vowel/@_fnt hr mk | |||
1 vowel/@_hgh no | |||
19 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_rp en_wm cy eo fr hu pl it pt pt_pt ++ | |||
1 vowel/i# cy | |||
5 vowel/i_2 de nl la sv | |||
2 vowel/i_3 af sk | |||
3 vowel/i_3 af fr sk | |||
4 vowel/i_4 fi hu it is | |||
5 vowel/i_5 en_sc | |||
3 vowel/i#_5 pt_pt ro | |||
@@ -602,6 +602,7 @@ | |||
1 vwl_sv/r_sv3 sv | |||
1 vwl_zh/aang zhy | |||
1 vwl_zh/ong zhy | |||
1 vwl_zh/ung zhy | |||
2 w/w base fr | |||
2 w/_w base fr | |||
1 w/w_ base |
@@ -41,7 +41,7 @@ endphoneme | |||
phoneme i | |||
vowel starttype (i) endtype (i) | |||
length 160 | |||
formants vowel/i | |||
formants vowel/i_3 | |||
linkout ; | |||
endphoneme | |||
@@ -279,16 +279,6 @@ phoneme v | |||
endphoneme | |||
phoneme B | |||
vcd blb frc | |||
vowelin f1=2 f2=1000 -300 -200 f3=-100 100 | |||
vowelout f1=2 f2=1000 -500 -300 f3=-100 60 len=50 | |||
lengthmod 6 | |||
formants b/b | |||
switchvoicing f | |||
endphoneme | |||
phoneme p | |||
vls blb stop | |||
vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11 | |||
@@ -308,3 +298,4 @@ endphoneme | |||
@@ -1,6 +1,4 @@ | |||
// Cantonese Chinese | |||
//================== | |||
//==================================================== | |||
// Tone Numbers | |||
//==================================================== | |||
@@ -105,7 +103,7 @@ phoneme aau | |||
endphoneme | |||
phoneme aang | |||
vowel starttype (a) endtype (u) | |||
vowel starttype (a) endtype (a) | |||
length 270 | |||
formants vwl_zh/aang | |||
endphoneme | |||
@@ -187,7 +185,7 @@ phoneme ou | |||
endphoneme | |||
phoneme ong | |||
vowel starttype (o) endtype (u) | |||
vowel starttype (o) endtype (o) | |||
length 220 | |||
formants vwl_zh/ong | |||
endphoneme | |||
@@ -201,6 +199,12 @@ phoneme u | |||
before N vowel/uu_bck | |||
endphoneme | |||
phoneme ung | |||
vowel starttype (u) endtype (u) | |||
length 200 | |||
formants vwl_zh/ung | |||
endphoneme | |||
phoneme ui | |||
vowel starttype (u) endtype (i) | |||
length 220 |
@@ -101,7 +101,7 @@ private: | |||
int CPhoneme(); | |||
void StartPhonemeTable(const char *name); | |||
void EndPhonemeTable(); | |||
void CPhonemeFiles(char *path_source); | |||
void CPhonemeFiles(); | |||
int NextItem(int type); | |||
void UngetItem(); | |||
void Error(const char *msg); | |||
@@ -173,7 +173,7 @@ private: | |||
}; | |||
char path_source[80]; | |||
char path_source[sizeof(path_home)+20]; | |||
Compile *compile; | |||
@@ -741,7 +741,7 @@ int Compile::LoadWavefile(FILE *f, const char *fname) | |||
int resample_wav = 0; | |||
char fname_temp[100]; | |||
int scale_factor=0; | |||
char command[200]; | |||
char command[sizeof(path_source)+200]; | |||
fseek(f,24,SEEK_SET); | |||
sr1 = Read4Bytes(f); | |||
@@ -894,7 +894,7 @@ int Compile::LoadDataFile(const char *path, int control) | |||
int hash; | |||
int type_code=' '; | |||
REF_HASH_TAB *p, *p2; | |||
char buf[256]; | |||
char buf[sizeof(path_source)+120]; | |||
count_references++; | |||
@@ -1630,12 +1630,12 @@ void Compile::StartPhonemeTable(const char *name) | |||
void Compile::CPhonemeFiles(char *path_source) | |||
{//=========================================== | |||
void Compile::CPhonemeFiles() | |||
{//========================== | |||
int phcode; | |||
int item; | |||
FILE *f; | |||
char buf[120]; | |||
char buf[sizeof(path_source)+120]; | |||
linenum = 1; | |||
n_phcodes = 1; // don't use phoneme code=0, it's used as string terminator | |||
@@ -1827,7 +1827,7 @@ void Compile::Report(void) | |||
REF_HASH_TAB *p; | |||
REF_HASH_TAB **list; | |||
FILE *f_report; | |||
char fname[80]; | |||
char fname[sizeof(path_source)+20]; | |||
// make a list of all the references and sort it | |||
list = (REF_HASH_TAB **)malloc(count_references * sizeof(REF_HASH_TAB *)); | |||
@@ -1989,7 +1989,7 @@ wxString CompileAllDictionaries() | |||
FILE *log; | |||
FILE *f_phused; | |||
char dictname[80]; | |||
char fname_log[80]; | |||
char fname_log[sizeof(path_dsource)+20]; | |||
char save_voice_name[80]; | |||
if(!wxDirExists(path_dictsource)) | |||
@@ -2073,7 +2073,7 @@ wxString CompileAllDictionaries() | |||
void Compile::CPhonemeTab(const char *source) | |||
{//======================================== | |||
char fname[130]; | |||
char fname[sizeof(path_source)+40]; | |||
wxString report; | |||
wxString report_dict; | |||
@@ -2176,7 +2176,7 @@ memset(markers_used,0,sizeof(markers_used)); | |||
n_phoneme_tabs = 0; | |||
stack_ix = 0; | |||
StartPhonemeTable("base"); | |||
CPhonemeFiles(path_source); | |||
CPhonemeFiles(); | |||
EndPhonemeTable(); | |||
WritePhonemeTable(); | |||
@@ -2233,7 +2233,7 @@ void CompileMbrola() | |||
char name1[40]; | |||
char name2[40]; | |||
char mbrola_voice[40]; | |||
char buf[150]; | |||
char buf[sizeof(path_home)+30]; | |||
int mbrola_ctrl = 20; // volume in 1/16 ths | |||
MBROLA_TAB data[N_PHONEME_TAB]; | |||
@@ -1301,9 +1301,9 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha | |||
FILE *f_out; | |||
int offset_rules=0; | |||
int value; | |||
char fname_buf[130]; | |||
char fname_temp[130]; | |||
char path[80]; | |||
char fname_buf[sizeof(path_home)+15]; | |||
char fname_temp[sizeof(path_home)+15]; | |||
char path[sizeof(path_home)+40]; // path_dsource+20 | |||
error_count = 0; | |||
@@ -127,7 +127,7 @@ int Translator::LoadDictionary(const char *name, int no_error) | |||
int length; | |||
FILE *f; | |||
unsigned int size; | |||
char fname[130]; | |||
char fname[sizeof(path_home)+20]; | |||
strcpy(dictionary_name,name); // currently loaded dictionary name | |||
@@ -22,7 +22,7 @@ | |||
#include <string.h> | |||
#include <getopt.h> | |||
#include <time.h> | |||
#include "sys/stat.h" | |||
#include <sys/stat.h> | |||
#include "speak_lib.h" | |||
@@ -427,8 +427,8 @@ void MyFrame::OnTools(wxCommandEvent& event) | |||
{//========================================= | |||
int err; | |||
FILE *log; | |||
char fname_log[80]; | |||
char err_fname[130]; | |||
char fname_log[sizeof(path_dsource)+12]; | |||
char err_fname[sizeof(path_home)+15]; | |||
switch(event.GetId()) | |||
{ |
@@ -21,8 +21,9 @@ | |||
#include <wx/dirdlg.h> | |||
#include "wx/filename.h" | |||
#include "wx/sound.h" | |||
#include "wx/dir.h" | |||
#include "sys/stat.h" | |||
#include <sys/stat.h> | |||
#include "speak_lib.h" | |||
#include "main.h" | |||
@@ -487,7 +488,8 @@ void Lexicon_Ru() | |||
int counts[20][20][10]; | |||
char phonemes[N_WORD_PHONEMES]; | |||
char buf[100]; | |||
char buf[120]; | |||
char fname[sizeof(path_dsource)+20]; | |||
// KOI8-R codes for Russian vowels | |||
static char vowels[] = {0xa3,0xc0,0xc1,0xc5,0xc9,0xcf,0xd1,0xd5,0xd9,0xdc,0}; | |||
@@ -543,18 +545,18 @@ void Lexicon_Ru() | |||
} | |||
input_length = GetFileLength(buf); | |||
sprintf(buf,"%s%c%s",path_dsource,PATHSEP,"ru_listx_1"); | |||
if((f_out = fopen(buf,"w")) == NULL) | |||
sprintf(fname,"%s%c%s",path_dsource,PATHSEP,"ru_listx_1"); | |||
if((f_out = fopen(fname,"w")) == NULL) | |||
{ | |||
wxLogError(_T("Can't write to: ")+wxString(buf,wxConvLocal)); | |||
wxLogError(_T("Can't write to: ")+wxString(fname,wxConvLocal)); | |||
fclose(f_in); | |||
return; | |||
} | |||
sprintf(buf,"%s%c%s",path_dsource,PATHSEP,"ru_log"); | |||
f_log = fopen(buf,"w"); | |||
sprintf(buf,"%s%c%s",path_dsource,PATHSEP,"ru_roots_1"); | |||
f_roots = fopen(buf,"w"); | |||
sprintf(fname,"%s%c%s",path_dsource,PATHSEP,"ru_log"); | |||
f_log = fopen(fname,"w"); | |||
sprintf(fname,"%s%c%s",path_dsource,PATHSEP,"ru_roots_1"); | |||
f_roots = fopen(fname,"w"); | |||
LoadVoice("ru",0); | |||
@@ -1211,6 +1213,7 @@ result = espeak_SetVoiceByProperties(&voice); | |||
return 0; | |||
} | |||
char* text1 = "Hello World2. <audio src=\"here\"> Some text</audio> This is the second sentence"; | |||
void TestTest(int control) | |||
@@ -1227,7 +1230,6 @@ void TestTest(int control) | |||
//CharsetToUnicode("ISO-8859-4"); | |||
//CharsetToUnicode("ISCII"); | |||
test4(); | |||
return; | |||
if(control==2) |
@@ -20,7 +20,7 @@ | |||
#include "wx/wx.h" | |||
#include "wx/fileconf.h" | |||
#include "sys/stat.h" | |||
#include <sys/stat.h> | |||
#include "speech.h" | |||
#ifdef PLATFORM_WINDOWS | |||
@@ -36,10 +36,8 @@ extern void strncpy0(char *to,const char *from, int size); | |||
extern int GetNumeric(wxTextCtrl *t); | |||
extern void SetNumeric(wxTextCtrl *t, int value); | |||
extern int samplerate; | |||
extern char path_home[120]; // .speak directory in user's HOME | |||
extern char voice_name[40]; | |||
wxString basedir; | |||
wxString path_spectload; | |||
wxString path_spectload2; | |||
wxString path_pitches; | |||
@@ -53,7 +51,7 @@ wxString path_modifiervoice; | |||
wxString path_dir1; | |||
int option_speed=160; | |||
char path_dsource[120]; | |||
char path_dsource[sizeof(path_home)+20]; | |||
BEGIN_EVENT_TABLE(Options, wxDialog) | |||
EVT_BUTTON(wxID_SAVE,Options::OnCommand) | |||
@@ -110,7 +108,7 @@ void Options::OnCommand(wxCommandEvent& event) | |||
void ConfigSetPaths() | |||
{//================== | |||
// set paths from wxStrings | |||
// set c_string paths from wxStrings | |||
strncpy0(path_source,path_phsource.mb_str(wxConvLocal),sizeof(path_source)-1); | |||
strcat(path_source,"/"); | |||
@@ -123,6 +121,7 @@ void ConfigInit() | |||
{//============== | |||
long value; | |||
wxString string; | |||
wxString basedir; | |||
const char *path_base; | |||
#ifdef PLATFORM_WINDOWS | |||
@@ -133,7 +132,7 @@ void ConfigInit() | |||
{ | |||
wxString RegVal; | |||
pRegKey->QueryValue(_T("Path"),RegVal); | |||
strcpy(buf,RegVal.mb_str(wxConvLocal)); | |||
strncpy0(buf,RegVal.mb_str(wxConvLocal),sizeof(buf)); | |||
path_base = buf; | |||
} | |||
else | |||
@@ -156,7 +155,7 @@ void ConfigInit() | |||
#endif | |||
WavegenInit(value,0); | |||
pConfig->Read(_T("/basedir"),&basedir,wxString(path_base,wxConvLocal)); | |||
basedir = wxString(path_base,wxConvLocal); // this is only used to set defaults for other paths if they are not in the config file | |||
pConfig->Read(_T("/spectload"),&path_spectload,basedir+_T("/phsource")); | |||
pConfig->Read(_T("/spectload2"),&path_spectload2,basedir+_T("/phsource")); | |||
pConfig->Read(_T("/pitchpath"),&path_pitches,basedir+_T("/pitch")); | |||
@@ -183,7 +182,6 @@ void ConfigSave(int exit) | |||
#ifndef PLATFORM_WINDOWS | |||
pConfig->Write(_T("/samplerate"),samplerate); | |||
#endif | |||
pConfig->Write(_T("/basedir"),basedir); | |||
pConfig->Write(_T("/spectload"),path_spectload); | |||
pConfig->Write(_T("/spectload2"),path_spectload2); | |||
pConfig->Write(_T("/pitchpath"),path_pitches); |
@@ -40,8 +40,8 @@ extern wxString path_dictsource; | |||
extern wxString path_modifiervoice; | |||
extern wxString path_dir1; | |||
extern char path_source[80]; | |||
extern char path_dsource[120]; | |||
extern char path_source[sizeof(path_home)+20]; | |||
extern char path_dsource[sizeof(path_home)+20]; | |||
extern int option_speed; | |||
@@ -34,6 +34,7 @@ | |||
#include "synthesize.h" | |||
#include "translate.h" | |||
#include <locale.h> | |||
#define N_XML_BUF 256 | |||
espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant); | |||
@@ -151,7 +152,131 @@ const int param_defaults[N_SPEECH_PARAM] = { | |||
}; | |||
#ifdef PLATFORM_RISCOS | |||
#ifdef NEED_WCHAR_FUNCTIONS | |||
// additional Latin characters beyond the Latin1 character set | |||
#define MAX_WALPHA 0x233 | |||
// indexed by character - 0x100 | |||
// 0=not alphabetic, 0xff=lower case, other=value to add to upper case to convert to lower case | |||
static unsigned char walpha_tab[MAX_WALPHA-0xff] = { | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 100 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 110 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 120 | |||
0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1, // 130 | |||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, // 140 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 150 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 160 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, // 170 | |||
0xff, 210, 1,0xff, 1,0xff, 206, 1,0xff, 205, 205, 1,0xff,0xff, 79, 202, // 180 | |||
203, 1,0xff, 205, 207,0xff, 211, 209, 1,0xff,0xff,0xff, 211, 213,0xff, 214, // 190 | |||
1,0xff, 1,0xff, 1,0xff, 218, 1,0xff, 218,0xff,0xff, 1,0xff, 218, 1, // 1a0 | |||
0xff, 217, 217, 1,0xff, 1,0xff, 219, 1,0xff,0xff,0xff, 1,0xff,0xff,0xff, // 1b0 | |||
0xff,0xff,0xff,0xff, 2, 1,0xff, 2, 1,0xff, 2, 1,0xff, 1,0xff, 1, // 1c0 | |||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, // 1d0 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1e0 | |||
0xff, 2, 1,0xff, 1,0xff,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1f0 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 200 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 210 | |||
0xff, 0, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 220 | |||
1,0xff, 1,0xff }; // 230 | |||
// use ctype.h functions for Latin1 (character < 0x100) | |||
int iswalpha(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isalpha(c)); | |||
if(c > MAX_WALPHA) | |||
return(0); | |||
return(walpha_tab[c-0x100]); | |||
} | |||
int iswdigit(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isdigit(c)); | |||
return(0); | |||
} | |||
int iswalnum(int c) | |||
{ | |||
if(iswdigit(c)) | |||
return(1); | |||
return(iswalpha(c)); | |||
} | |||
int towlower(int c) | |||
{ | |||
int x; | |||
if(c < 0x100) | |||
return(tolower(c)); | |||
if((c > MAX_WALPHA) || ((x = walpha_tab[c-0x100])==0xff)) | |||
return(c); // already lower case | |||
return(c + x); // convert to lower case | |||
} | |||
int towupper(int c) | |||
{ | |||
// check whether the previous character code is the upper-case equivalent of this character | |||
if(tolower(c-1) == c) | |||
return(c-1); // yes, use it | |||
return(c); // no | |||
} | |||
int iswupper(int c) | |||
{ | |||
int x; | |||
if(c < 0x100) | |||
return(isupper(c)); | |||
if(((c > MAX_WALPHA) || (x = walpha_tab[c-0x100])==0) || (x == 0xff)) | |||
return(0); | |||
return(1); | |||
} | |||
int iswlower(int c) | |||
{ | |||
if(c < 0x100) | |||
return(islower(c)); | |||
if((c > MAX_WALPHA) || (walpha_tab[c-0x100] != 0xff)) | |||
return(0); | |||
return(1); | |||
} | |||
int iswspace(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isspace(c)); | |||
return(0); | |||
} | |||
int iswpunct(int c) | |||
{ | |||
if(c < 0x100) | |||
return(ispunct(c)); | |||
return(0); | |||
} | |||
const wchar_t *wcschr(const wchar_t *str, int c) | |||
{ | |||
while(*str != 0) | |||
{ | |||
if(*str == c) | |||
return(str); | |||
str++; | |||
} | |||
return(NULL); | |||
} | |||
const int wcslen(const wchar_t *str) | |||
{ | |||
int ix=0; | |||
while(*str != 0) | |||
{ | |||
ix++; | |||
} | |||
return(ix); | |||
} | |||
float wcstod(const wchar_t *str, wchar_t **tailptr) | |||
{ | |||
int ix; | |||
@@ -395,8 +520,8 @@ static int LoadSoundFile(const char *fname, int index) | |||
int *ip; | |||
int length; | |||
char fname_temp[100]; | |||
char fname2[200]; | |||
char command[150]; | |||
char fname2[sizeof(path_home)+13+40]; | |||
char command[sizeof(fname2)+sizeof(fname2)+30]; | |||
if(fname == NULL) | |||
fname = soundicon_tab[index].filename; |
@@ -24,19 +24,23 @@ | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#ifndef PLATFORM_DOS | |||
#ifdef PLATFORM_WINDOWS | |||
#include <windows.h> | |||
#include <winreg.h> | |||
#else | |||
#include <unistd.h> | |||
#endif | |||
#endif | |||
#ifndef NEED_GETOPT | |||
#include <getopt.h> | |||
#endif | |||
#include <time.h> | |||
#include <signal.h> | |||
#include <locale.h> | |||
#include "sys/stat.h" | |||
#include <sys/stat.h> | |||
#include "speak_lib.h" | |||
#include "voice.h" | |||
@@ -46,7 +50,8 @@ | |||
char path_home[120]; | |||
char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
char wavefile[120]; | |||
int (* uri_callback)(int, const char *, const char *) = NULL; | |||
int (* phoneme_callback)(const char *) = NULL; | |||
@@ -225,11 +230,11 @@ static void init_path(void) | |||
unsigned long size; | |||
unsigned long var_type; | |||
char *env; | |||
unsigned char buf[100]; | |||
unsigned char buf[sizeof(path_home)-12]; | |||
if((env = getenv("ESPEAK_DATA_PATH")) != NULL) | |||
if(((env = getenv("ESPEAK_DATA_PATH")) != NULL) && ((strlen(env)+12) < sizeof(path_home))) | |||
{ | |||
sprintf(path_home,"%s/espeak-data",env); | |||
sprintf(path_home,"%s\\espeak-data",env); | |||
if(GetFileLength(path_home) == -2) | |||
return; // an espeak-data directory exists | |||
} | |||
@@ -242,6 +247,9 @@ static void init_path(void) | |||
sprintf(path_home,"%s\\espeak-data",buf); | |||
#else | |||
#ifdef PLATFORM_DOS | |||
strcpy(path_home,PATH_ESPEAK_DATA); | |||
#else | |||
// char *env; | |||
// if((env = getenv("ESPEAK_DATA_PATH")) != NULL) | |||
// { | |||
@@ -256,6 +264,7 @@ static void init_path(void) | |||
strcpy(path_home,PATH_ESPEAK_DATA); | |||
} | |||
#endif | |||
#endif | |||
} | |||
@@ -553,14 +562,22 @@ int main (int argc, char **argv) | |||
if(flag_compile) | |||
{ | |||
#ifdef PLATFORM_DOS | |||
char path_dsource[sizeof(path_home)+20]; | |||
strcpy(path_dsource,path_home); | |||
path_dsource[strlen(path_home)-11] = 0; // remove "espeak-data" from the end | |||
strcat(path_dsource,"dictsource\\"); | |||
CompileDictionary(path_dsource,dictionary_name,NULL,NULL); | |||
#else | |||
#ifdef PLATFORM_WINDOWS | |||
char path_dsource[120]; | |||
char path_dsource[sizeof(path_home)+20]; | |||
strcpy(path_dsource,path_home); | |||
path_dsource[strlen(path_home)-11] = 0; // renove "espeak-data" from the end | |||
path_dsource[strlen(path_home)-11] = 0; // remove "espeak-data" from the end | |||
strcat(path_dsource,"dictsource\\"); | |||
CompileDictionary(path_dsource,dictionary_name,NULL,NULL); | |||
#else | |||
CompileDictionary(NULL,dictionary_name,NULL,NULL); | |||
#endif | |||
#endif | |||
exit(0); | |||
} |
@@ -30,7 +30,7 @@ | |||
#include "speech.h" | |||
#include "sys/stat.h" | |||
#include <sys/stat.h> | |||
#ifndef PLATFORM_WINDOWS | |||
#include <unistd.h> | |||
#endif | |||
@@ -63,7 +63,7 @@ t_espeak_callback* synth_callback = NULL; | |||
int (* uri_callback)(int, const char *, const char *) = NULL; | |||
int (* phoneme_callback)(const char *) = NULL; | |||
char path_home[120]; | |||
char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
voice_t voicedata; | |||
voice_t *voice = &voicedata; | |||
@@ -285,7 +285,7 @@ static void init_path(const char *path) | |||
unsigned long size; | |||
unsigned long var_type; | |||
char *env; | |||
unsigned char buf[100]; | |||
unsigned char buf[sizeof(path_home)-13]; | |||
if(path != NULL) | |||
{ | |||
@@ -309,7 +309,7 @@ static void init_path(const char *path) | |||
sprintf(path_home,"%s\\espeak-data",buf); | |||
#else | |||
char *env; | |||
// char *env; | |||
if(path != NULL) | |||
{ |
@@ -129,122 +129,6 @@ static const char *help_text = | |||
"\t If <language> is omitted, then list all voices.\n"; | |||
// additional Latin characters beyond the Latin1 character set | |||
#define MAX_WALPHA 0x233 | |||
// indexed by character - 0x100 | |||
// 0=not alphabetic, 0xff=lower case, other=value to add to upper case to convert to lower case | |||
static unsigned char walpha_tab[MAX_WALPHA-0xff] = { | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 100 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 110 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 120 | |||
0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1, // 130 | |||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, // 140 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 150 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 160 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, // 170 | |||
0xff, 210, 1,0xff, 1,0xff, 206, 1,0xff, 205, 205, 1,0xff,0xff, 79, 202, // 180 | |||
203, 1,0xff, 205, 207,0xff, 211, 209, 1,0xff,0xff,0xff, 211, 213,0xff, 214, // 190 | |||
1,0xff, 1,0xff, 1,0xff, 218, 1,0xff, 218,0xff,0xff, 1,0xff, 218, 1, // 1a0 | |||
0xff, 217, 217, 1,0xff, 1,0xff, 219, 1,0xff,0xff,0xff, 1,0xff,0xff,0xff, // 1b0 | |||
0xff,0xff,0xff,0xff, 2, 1,0xff, 2, 1,0xff, 2, 1,0xff, 1,0xff, 1, // 1c0 | |||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, // 1d0 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1e0 | |||
0xff, 2, 1,0xff, 1,0xff,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1f0 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 200 | |||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 210 | |||
0xff, 0, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 220 | |||
1,0xff, 1,0xff }; // 230 | |||
// use ctype.h functions for Latin1 (character < 0x100) | |||
int iswalpha(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isalpha(c)); | |||
if(c > MAX_WALPHA) | |||
return(0); | |||
return(walpha_tab[c-0x100]); | |||
} | |||
int iswdigit(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isdigit(c)); | |||
return(0); | |||
} | |||
int iswalnum(int c) | |||
{ | |||
if(iswdigit(c)) | |||
return(1); | |||
return(iswalpha(c)); | |||
} | |||
int towlower(int c) | |||
{ | |||
int x; | |||
if(c < 0x100) | |||
return(tolower(c)); | |||
if((c > MAX_WALPHA) || ((x = walpha_tab[c-0x100])==0xff)) | |||
return(c); // already lower case | |||
return(c + x); // convert to lower case | |||
} | |||
int iswupper(int c) | |||
{ | |||
int x; | |||
if(c < 0x100) | |||
return(isupper(c)); | |||
if(((c > MAX_WALPHA) || (x = walpha_tab[c-0x100])==0) || (x == 0xff)) | |||
return(0); | |||
return(1); | |||
} | |||
int iswlower(int c) | |||
{ | |||
if(c < 0x100) | |||
return(islower(c)); | |||
if((c > MAX_WALPHA) || (walpha_tab[c-0x100] != 0xff)) | |||
return(0); | |||
return(1); | |||
} | |||
int iswspace(int c) | |||
{ | |||
if(c < 0x100) | |||
return(isspace(c)); | |||
return(0); | |||
} | |||
int iswpunct(int c) | |||
{ | |||
if(c < 0x100) | |||
return(ispunct(c)); | |||
return(0); | |||
} | |||
const wchar_t *wcschr(const wchar_t *str, int c) | |||
{ | |||
while(*str != 0) | |||
{ | |||
if(*str == c) | |||
return(str); | |||
str++; | |||
} | |||
return(NULL); | |||
} | |||
const int wcslen(const wchar_t *str) | |||
{ | |||
int ix=0; | |||
while(*str != 0) | |||
{ | |||
ix++; | |||
} | |||
return(ix); | |||
} | |||
int GetFileLength(const char *filename) | |||
{//==================================== | |||
int length=0; | |||
@@ -284,7 +168,7 @@ void ReadVoiceNames2(char *directory) | |||
_kernel_swi_regs regs; | |||
_kernel_oserror *error; | |||
char buf[80]; | |||
char directory2[80]; | |||
char directory2[sizeof(path_home)+100]; | |||
regs.r[0] = 10; | |||
regs.r[1] = (int)directory; | |||
@@ -324,7 +208,7 @@ void ReadVoiceNames2(char *directory) | |||
void ReadVoiceNames() | |||
{//=================== | |||
char directory[80]; | |||
char directory[sizeof(path_home)+10]; | |||
for(n_voice_files=0; n_voice_files<N_VOICE_NAMES; n_voice_files++) | |||
voice_names[n_voice_files] = NULL; |
@@ -87,9 +87,10 @@ int GetFileLength(const char *filename); | |||
char *Alloc(int size); | |||
void Free(void *ptr); | |||
#define N_PATH_HOME 120 | |||
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
extern void strncpy0(char *to,const char *from, int size); | |||
extern char path_home[]; | |||
extern const char *version_string; | |||
extern const int version_phdata; | |||
extern void strncpy0(char *to,const char *from, int size); | |||
@@ -116,7 +116,7 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans) | |||
int size; | |||
FILE *f_in; | |||
char path[150]; | |||
char path[sizeof(path_home)+15]; | |||
mbrola_name[0] = 0; | |||
if(mbrola_voice == NULL) |
@@ -35,7 +35,7 @@ | |||
#include "translate.h" | |||
#include "wave.h" | |||
const char *version_string = "1.28.01 17.Jul.07"; | |||
const char *version_string = "1.28.03 30.Jul.07"; | |||
const int version_phdata = 0x012801; | |||
int option_device_number = -1; | |||
@@ -79,7 +79,7 @@ static int ReadPhFile(char **ptr, const char *fname) | |||
FILE *f_in; | |||
char *p; | |||
unsigned int length; | |||
char buf[200]; | |||
char buf[sizeof(path_home)+40]; | |||
sprintf(buf,"%s%c%s",path_home,PATHSEP,fname); | |||
length = GetFileLength(buf); | |||
@@ -604,7 +604,7 @@ int SelectPhonemeTableName(const char *name) | |||
void LoadConfig(void) | |||
{//================== | |||
// Load configuration file, if one exists | |||
char buf[130]; | |||
char buf[sizeof(path_home)+10]; | |||
FILE *f; | |||
int ix; | |||
char c1; |
@@ -288,6 +288,7 @@ Translator *SelectTranslator(const char *name) | |||
case L('h','r'): // Croatian | |||
case L('b','s'): // Bosnian | |||
case L('s','r'): // Serbian | |||
{ | |||
static int stress_amps_hr[8] = {16,16, 20,20, 20,24, 24,22 }; |
@@ -1594,7 +1594,7 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i | |||
new_c = langopts.replacement_chars[ix]; | |||
break; | |||
} | |||
if((word >> 16) == tolower(next_in)) | |||
if((word >> 16) == (unsigned int)tolower(next_in)) | |||
{ | |||
new_c = langopts.replacement_chars[ix]; | |||
ignore_next = 1; | |||
@@ -1616,10 +1616,9 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i | |||
*insert = c2; | |||
new_c &= 0xffff; | |||
} | |||
#ifndef PLATFORM_RISCOS | |||
if(upper_case) | |||
new_c = towupper(new_c); | |||
#endif | |||
return(new_c); | |||
} | |||
@@ -247,7 +247,7 @@ void TranslDlg::ReadVoice() | |||
{//======================== | |||
wxString path; | |||
wxString filename; | |||
char fname[130]; | |||
char fname[sizeof(path_home)+10]; | |||
sprintf(fname,"%s/voices",path_home); | |||
path = wxFileSelector(_T("Load voice"),wxString(fname,wxConvLocal),_T(""),_T(""),_T("*"),wxOPEN); |
@@ -59,7 +59,7 @@ int formant_rate[9]; // values adjusted for actual sample rate | |||
#define DEFAULT_LANGUAGE_PRIORITY 5 | |||
#define N_VOICES_LIST 100 | |||
#define N_VOICES_LIST 150 | |||
static int n_voices_list = 0; | |||
static espeak_VOICE *voices_list[N_VOICES_LIST]; | |||
static int len_path_voices; | |||
@@ -226,11 +226,12 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char*lea | |||
// Read a Voice file, allocate a VOICE_DATA and set data from the | |||
// file's language, gender, name lines | |||
char linebuf[120]; | |||
char linebuf[80]; | |||
char vname[80]; | |||
char vgender[80]; | |||
char vlanguage[80]; | |||
char languages[300]; // allow space for several alternate language names and priorities | |||
char fname_buf[sizeof(path_home)+15]; | |||
unsigned int len; | |||
@@ -249,9 +250,9 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char*lea | |||
// check whether the mbrola speech data is present for this voice | |||
memcpy(vname,&leafname[3],3); | |||
vname[3] = 0; | |||
sprintf(linebuf,"%s/mbrola/%s",path_home,vname); | |||
sprintf(fname_buf,"%s/mbrola/%s",path_home,vname); | |||
if(GetFileLength(linebuf) <= 0) | |||
if(GetFileLength(fname_buf) <= 0) | |||
return(0); | |||
} | |||
#endif | |||
@@ -534,7 +535,7 @@ voice_t *LoadVoice(const char *vname, int control) | |||
char phonemes_name[40]; | |||
char *language_type; | |||
char buf[200]; | |||
char path_voices[140]; | |||
char path_voices[sizeof(path_home)+12]; | |||
char langname[4]; | |||
int stress_amps[8]; | |||
@@ -1327,7 +1328,7 @@ void GetVoices(const char *path) | |||
FILE *f_voice; | |||
espeak_VOICE *voice_data; | |||
int ftype; | |||
char fname[140]; | |||
char fname[sizeof(path_home)+100]; | |||
#ifdef PLATFORM_RISCOS | |||
#else | |||
@@ -1500,7 +1501,7 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec) | |||
int ix; | |||
static espeak_VOICE *voices[N_VOICES_LIST]; | |||
char selected_voice_id[80]; | |||
char path_voices[130]; | |||
char path_voices[sizeof(path_home)+12]; | |||
// free previous voice list data | |||
if((voice_selected != NULL) && (voice_selected->identifier != NULL)) |
@@ -35,11 +35,11 @@ | |||
#include "phoneme.h" | |||
#include "synthesize.h" | |||
#include "translate.h" | |||
#include "options.h" | |||
/* Read a file of vowel symbols and f1,f2 formants, and produce a vowel diagram | |||
*/ | |||
extern wxString path_phsource; | |||
extern char path_source[]; | |||
extern char voice_name[]; | |||
extern char *spects_data; | |||
@@ -458,8 +458,8 @@ void MakeVowelLists(void) | |||
SPECT_SEQ *seq; | |||
frame_t *frame; | |||
int match_level; | |||
char dirname[100]; | |||
char fname[120]; | |||
char dirname[sizeof(path_source)+20]; | |||
char fname[sizeof(dirname)+40]; | |||
progress = new wxProgressDialog(_T("Vowel charts"),_T(""),n_phoneme_tables); | |||
@@ -100,11 +100,11 @@ static void init_buffer() | |||
SHOW("init_buffer > myRead=0x%x, myWrite=0x%x, BUFFER_LENGTH=0x%x, myReadPosition = myWritePosition = 0\n", (int)myRead, (int)myWrite, BUFFER_LENGTH); | |||
} | |||
static int get_used_mem() | |||
static unsigned int get_used_mem() | |||
{ | |||
char* aRead = myRead; | |||
char* aWrite = myWrite; | |||
int used = 0; | |||
unsigned int used = 0; | |||
assert ((aRead >= myBuffer) | |||
&& (aRead <= myBuffer + BUFFER_LENGTH) | |||
@@ -129,12 +129,13 @@ static int get_used_mem() | |||
static void start_stream() | |||
{ | |||
PaError err; | |||
SHOW_TIME("start_stream"); | |||
my_stream_could_start=0; | |||
mInCallbackFinishedState = false; | |||
PaError err = Pa_StartStream(pa_stream); | |||
err = Pa_StartStream(pa_stream); | |||
SHOW("start_stream > Pa_StartStream=%d (%s)\n", err, Pa_GetErrorText(err)); | |||
#if USE_PORTAUDIO == 19 |
@@ -1,7 +1,9 @@ | |||
#ifndef WAVE_H | |||
#define WAVE_H | |||
#ifndef PLATFORM_DOS | |||
#include "stdint.h" | |||
#endif | |||
extern int option_device_number; | |||
@@ -26,17 +26,17 @@ | |||
// comment this out when compiling the "speak" process | |||
//#define SPECT_EDITOR | |||
#include <windows.h> | |||
#define PLATFORM_WINDOWS | |||
#define __WIN32__ | |||
#define mkdir(p1,p2) mkdir(p1) | |||
#define PLATFORM_WINDOWS | |||
#define __WIN32__ | |||
#define mkdir(p1,p2) mkdir(p1) | |||
#define PATHSEP '\\' | |||
#define USE_PORTAUDIO | |||
//#define USE_NANOSLEEP | |||
#define __cdecl | |||
#define ESPEAK_API | |||
#define ESPEAK_API | |||
#define PATH_ESPEAK_DATA "C:\\Program files\\espeak\\espeak-data" | |||
typedef unsigned short USHORT; | |||
@@ -72,8 +72,9 @@ int GetFileLength(const char *filename); | |||
char *Alloc(int size); | |||
void Free(void *ptr); | |||
#define N_PATH_HOME 120 | |||
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
extern const char *version_string; | |||
extern const int version_phdata; | |||
extern void strncpy0(char *to,const char *from, int size); | |||
extern char path_home[]; | |||
extern const int version_phdata; | |||
extern const char *version_string; |
@@ -75,9 +75,10 @@ char *Alloc(int size); | |||
void Free(void *ptr); | |||
extern void strncpy0(char *to,const char *from, int size); | |||
extern char path_home[]; | |||
#define N_PATH_HOME 120 | |||
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
extern const int version_phdata; | |||
extern const char *version_string; | |||
extern const int version_phdata; | |||
extern void strncpy0(char *to,const char *from, int size); | |||
@@ -1,12 +1,12 @@ | |||
#ifndef SPEAK_LIB_H | |||
#define SPEAK_LIB_H | |||
/*************************************************************************** | |||
* Copyright (C) 2006 by Jonathan Duddington * | |||
* [email protected] * | |||
* Copyright (C) 2005 to 2007 by Jonathan Duddington * | |||
* email: [email protected] * | |||
* * | |||
* This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | |||
* the Free Software Foundation; either version 3 of the License, or * | |||
* (at your option) any later version. * | |||
* * | |||
* This program is distributed in the hope that it will be useful, * | |||
@@ -15,9 +15,8 @@ | |||
* GNU General Public License for more details. * | |||
* * | |||
* You should have received a copy of the GNU General Public License * | |||
* along with this program; if not, write to the * | |||
* Free Software Foundation, Inc., * | |||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |||
* along with this program; if not, see: * | |||
* <http://www.gnu.org/licenses/>. * | |||
***************************************************************************/ | |||
@@ -29,14 +28,12 @@ | |||
#include <stdio.h> | |||
#define ESPEAK_LIB_REVISION 2 | |||
#define ESPEAK_API_REVISION 2 | |||
/* | |||
Revision 2 | |||
Added parameter "options" to eSpeakInitialize() | |||
*/ | |||
/********************/ | |||
/* Initialization */ | |||
/********************/ | |||
@@ -49,7 +46,8 @@ typedef enum { | |||
espeakEVENT_MARK, // Mark | |||
espeakEVENT_PLAY, // Audio element | |||
espeakEVENT_END, // End of sentence | |||
espeakEVENT_MSG_TERMINATED // End of message | |||
espeakEVENT_MSG_TERMINATED, // End of message | |||
espeakEVENT_PHONEME // Phoneme, if enabled in espeak_Initialize() | |||
} espeak_EVENT_TYPE; | |||
@@ -63,7 +61,7 @@ typedef struct { | |||
int sample; // sample id (internal use) | |||
void* user_data; // pointer supplied by the calling program | |||
union { | |||
int number; // used for WORD and SENTENCE events | |||
int number; // used for WORD and SENTENCE events. For PHONEME events this is the phoneme mnemonic. | |||
const char *name; // used for MARK and PLAY events. UTF8 string | |||
} id; | |||
} espeak_EVENT; | |||
@@ -146,7 +144,7 @@ typedef enum { | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path); | |||
int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options); | |||
/* Must be called before any synthesis functions are called. | |||
output: the audio data can either be played by eSpeak or passed back by the SynthCallback function. | |||
@@ -154,7 +152,10 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, cons | |||
path: The directory which contains the espeak-data directory, or NULL for the default location. | |||
Returns: sample rate in Hz | |||
options: bit 0: 1=allow espeakEVENT_PHONEME events. | |||
Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR). | |||
*/ | |||
typedef int (t_espeak_callback)(short*, int, espeak_EVENT*); | |||
@@ -162,7 +163,7 @@ typedef int (t_espeak_callback)(short*, int, espeak_EVENT*); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); | |||
void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); | |||
/* Must be called before any synthesis functions are called. | |||
This specifies a function in the calling program which is called when a buffer of | |||
speech sound data has been produced. | |||
@@ -180,7 +181,8 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events); | |||
sometimes be zero (which does NOT indicate end of synthesis). | |||
events: an array of espeak_EVENT items which indicate word and sentence events, and | |||
also the occurance if <mark> and <audio> elements within the text. | |||
also the occurance if <mark> and <audio> elements within the text. The list of | |||
events is terminated by an event of type = 0. | |||
Callback returns: 0=continue synthesis, 1=abort synthesis. | |||
@@ -189,7 +191,7 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*)); | |||
void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*)); | |||
/* This function may be called before synthesis functions are used, in order to deal with | |||
<audio> tags. It specifies a callback function which is called when an <audio> element is | |||
encountered and allows the calling program to indicate whether the sound file which | |||
@@ -229,7 +231,7 @@ int UriCallback(int type, const char *uri, const char *base); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Synth(const void *text, | |||
espeak_ERROR espeak_Synth(const void *text, | |||
size_t size, | |||
unsigned int position, | |||
espeak_POSITION_TYPE position_type, | |||
@@ -266,7 +268,7 @@ ESPEAK_API espeak_ERROR espeak_Synth(const void *text, | |||
espeakSSML Elements within < > are treated as SSML elements, or if not recognised are ignored. | |||
espeakPHONEMES Text within [[ ]] is treated as phonemes codes (in espeak's Hirschenbaum encoding). | |||
espeakPHONEMES Text within [[ ]] is treated as phonemes codes (in espeak's Hirshenbaum encoding). | |||
espeakENDPAUSE If set then a sentence pause is added at the end of the text. If not set then | |||
this pause is suppressed. | |||
@@ -285,7 +287,7 @@ ESPEAK_API espeak_ERROR espeak_Synth(const void *text, | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text, | |||
espeak_ERROR espeak_Synth_Mark(const void *text, | |||
size_t size, | |||
const char *index_mark, | |||
unsigned int end_position, | |||
@@ -309,7 +311,7 @@ ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text, | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name); | |||
espeak_ERROR espeak_Key(const char *key_name); | |||
/* Speak the name of a keyboard key. | |||
Currently this just speaks the "key_name" as given | |||
@@ -322,7 +324,7 @@ ESPEAK_API espeak_ERROR espeak_Key(const char *key_name); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Char(wchar_t character); | |||
espeak_ERROR espeak_Char(wchar_t character); | |||
/* Speak the name of the given character | |||
Return: EE_OK: operation achieved | |||
@@ -362,7 +364,7 @@ typedef enum { | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative); | |||
espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative); | |||
/* Sets the value of the specified parameter. | |||
relative=0 Sets the absolute value of the parameter. | |||
relative=1 Sets a relative value of the parameter. | |||
@@ -372,9 +374,9 @@ ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int valu | |||
espeakVOLUME: volume in range 0-100 0=silence | |||
espeakPITCH: base pitch in Hz | |||
espeakPITCH: base pitch, range 0-100. 50=normal | |||
espeakRANGE: pitch range in Hz | |||
espeakRANGE: pitch range, range 0-100. 0-monotone, 50=normal | |||
espeakPUNCTUATION: which punctuation characters to announce: | |||
value in espeak_PUNCT_TYPE (none, all, some), | |||
@@ -396,7 +398,7 @@ ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int valu | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API int espeak_GetParameter(espeak_PARAMETER parameter, int current); | |||
int espeak_GetParameter(espeak_PARAMETER parameter, int current); | |||
/* current=0 Returns the default value of the specified parameter. | |||
current=1 Returns the current value of the specified parameter, as set by SetParameter() | |||
*/ | |||
@@ -404,7 +406,7 @@ ESPEAK_API int espeak_GetParameter(espeak_PARAMETER parameter, int current); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist); | |||
espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist); | |||
/* Specified a list of punctuation characters whose names are to be spoken when the | |||
value of the Punctuation parameter is set to "some". | |||
@@ -419,7 +421,7 @@ ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream); | |||
void espeak_SetPhonemeTrace(int value, FILE *stream); | |||
/* Controls the output of phoneme symbols for the text | |||
value=0 No phoneme output (default) | |||
value=1 Output the translated phoneme symbols for the text | |||
@@ -431,7 +433,7 @@ ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log); | |||
void espeak_CompileDictionary(const char *path, FILE *log); | |||
/* Compile pronunciation dictionary for a language which corresponds to the currently | |||
selected voice. The required voice should be selected before calling this function. | |||
@@ -481,7 +483,7 @@ typedef struct { | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec); | |||
const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec); | |||
/* Reads the voice files from espeak-data/voices and creates an array of espeak_VOICE pointers. | |||
The list is terminated by a NULL pointer | |||
@@ -493,7 +495,7 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name); | |||
espeak_ERROR espeak_SetVoiceByName(const char *name); | |||
/* Searches for a voice with a matching "name" field. Language is not considered. | |||
"name" is a UTF8 string. | |||
@@ -506,7 +508,7 @@ ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec); | |||
espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec); | |||
/* An espeak_VOICE structure is used to pass criteria to select a voice. Any of the following | |||
fields may be set: | |||
@@ -526,7 +528,7 @@ ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_VOICE *espeak_GetCurrentVoice(void); | |||
espeak_VOICE *espeak_GetCurrentVoice(void); | |||
/* Returns the espeak_VOICE data for the currently selected voice. | |||
This is not affected by temporary voice changes caused by SSML elements such as <voice> and <s> | |||
*/ | |||
@@ -534,7 +536,7 @@ ESPEAK_API espeak_VOICE *espeak_GetCurrentVoice(void); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Cancel(void); | |||
espeak_ERROR espeak_Cancel(void); | |||
/* Stop immediately synthesis and audio output of the current text. When this | |||
function returns, the audio output is fully stopped and the synthesizer is ready to | |||
synthesize a new message. | |||
@@ -547,14 +549,14 @@ ESPEAK_API espeak_ERROR espeak_Cancel(void); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API int espeak_IsPlaying(void); | |||
int espeak_IsPlaying(void); | |||
/* Returns 1 if audio is played, 0 otherwise. | |||
*/ | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Synchronize(void); | |||
espeak_ERROR espeak_Synchronize(void); | |||
/* This function returns when all data have been spoken. | |||
Return: EE_OK: operation achieved | |||
EE_INTERNAL_ERROR. | |||
@@ -563,7 +565,7 @@ ESPEAK_API espeak_ERROR espeak_Synchronize(void); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API espeak_ERROR espeak_Terminate(void); | |||
espeak_ERROR espeak_Terminate(void); | |||
/* last function to be called. | |||
Return: EE_OK: operation achieved | |||
EE_INTERNAL_ERROR. | |||
@@ -573,7 +575,7 @@ ESPEAK_API espeak_ERROR espeak_Terminate(void); | |||
#ifdef __cplusplus | |||
extern "C" | |||
#endif | |||
ESPEAK_API const char *espeak_Info(void* ptr); | |||
const char *espeak_Info(void* ptr); | |||
/* Returns the version number string. | |||
The parameter is for future use, and should be set to NULL | |||
*/ |
@@ -76,9 +76,10 @@ char *Alloc(int size); | |||
void Free(void *ptr); | |||
extern void strncpy0(char *to,const char *from, int size); | |||
extern char path_home[]; | |||
#define N_PATH_HOME 120 | |||
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
extern const int version_phdata; | |||
extern const char *version_string; | |||
extern const int version_phdata; | |||
extern void strncpy0(char *to,const char *from, int size); | |||
@@ -80,9 +80,10 @@ char *Alloc(int size); | |||
void Free(void *ptr); | |||
extern void strncpy0(char *to,const char *from, int size); | |||
extern char path_home[]; | |||
#define N_PATH_HOME 120 | |||
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
extern const int version_phdata; | |||
extern const char *version_string; | |||
extern const int version_phdata; | |||
extern void strncpy0(char *to,const char *from, int size); | |||