x z Z | x z Z | ||||
Dictionary hu_dict 2011-09-15 | |||||
Dictionary hu_dict 2011-10-07 | |||||
a A a: E e: i i: o | a A a: E e: i i: o | ||||
o: u u: Y y y: Y: | o: u u: Y y y: Y: | ||||
ts v x z | ts v x z | ||||
Dictionary en_dict 2011-09-08 | |||||
Dictionary en_dict 2011-09-27 | |||||
0 3 3: @ @- @2 @5 @L | 0 3 3: @ @- @2 @5 @L | ||||
a a# A: A@ aa aI aI@ aU | a a# A: A@ aa aI aI@ aU |
obstacle 0bst@k@L | obstacle 0bst@k@L | ||||
ocean oUS@n | ocean oUS@n | ||||
oceanic oUSI'anIk | oceanic oUSI'anIk | ||||
ocelot 0s@l0t | |||||
ochre oUk3 | ochre oUk3 | ||||
o'clock @kl0k | o'clock @kl0k | ||||
october $2 | october $2 |
.L01 l r | .L01 l r | ||||
.L02 i y | .L02 i y | ||||
.L03 a i o u // vowel, not 'e' | .L03 a i o u // vowel, not 'e' | ||||
.L05 c g k | |||||
.L10 grap log met scop // scientific endings | .L10 grap log met scop // scientific endings | ||||
o) mb (e m | o) mb (e m | ||||
_bo) mb (K m | _bo) mb (K m | ||||
_du) mb m | _du) mb m | ||||
_) mc m@k | |||||
_) mc (_k m@ | |||||
_) mc (k m@ | |||||
_) mc (_g m@ | |||||
_) mc (g m@ | |||||
_) mc (C m@k | |||||
_) mc (_C m@k | |||||
_) mc (_L05 m@ // c,g,k | |||||
_) mc (L05 m@ | |||||
_) mc (A mak | _) mc (A mak | ||||
_) mc (-A mak | |||||
_) mc (_A mak | |||||
mn (_ m | mn (_ m | ||||
&B) me (_ m%I | &B) me (_ m%I | ||||
_) mega mEg@ | _) mega mEg@ |
jelentőségű $unstressend | jelentőségű $unstressend | ||||
elárulta $unstressend | elárulta $unstressend | ||||
bolygón $unstressend | bolygón $unstressend | ||||
rázni $unstressend | |||||
szóltam $unstressend | |||||
fogadni $unstressend | |||||
levonni $unstressend | |||||
gond $unstressend | |||||
jelzéseket $unstressend | |||||
modellből $unstressend | |||||
kiadás $unstressend | |||||
bántani $unstressend | |||||
szándéka $unstressend | |||||
körét $unstressend | |||||
arányát $unstressend | |||||
fellépést $unstressend | |||||
támogatás $unstressend | |||||
felelőséget $unstressend | |||||
felelősséget $unstressend | |||||
felhasználni $unstressend | |||||
fordítsák $unstressend | |||||
szolgálják $unstressend | |||||
fordítható $unstressend | |||||
gazdaságot $unstressend | |||||
fizetnek $unstressend | |||||
utalványban $unstressend | |||||
találmány $unstressend | |||||
bevezettek $unstressend | |||||
hivatkozva $unstressend | |||||
bírálták $unstressend | |||||
szabadságát $unstressend | |||||
nyújtását $unstressend | |||||
támogatást $unstressend | |||||
bért $unstressend | |||||
juttatást $unstressend | |||||
elérhető $unstressend | |||||
adatok $unstressend | |||||
juttatás $unstressend | |||||
fizet $unstressend | |||||
számláit $unstressend | |||||
szinten $unstressend | |||||
rendszerét $unstressend | |||||
páron $unstressend | |||||
férfin $unstressend | |||||
emberen $unstressend | |||||
hátránya $unstressend | |||||
elvehetik $unstressend | |||||
árát $unstressend | |||||
önkormányzatoknál $unstressend | |||||
adják $unstressend | |||||
hírek $unstressend | |||||
kilós $unstressend | |||||
formájában $unstressend | |||||
annál $unstressend | |||||
ennél $unstressend | |||||
mondod $unstressend | |||||
funkciókat $unstressend | |||||
nyomom $unstressend | |||||
alakulni $unstressend | |||||
bajaim $unstressend | |||||
oprendszert $unstressend | |||||
szántam $unstressend | |||||
szántad $unstressend | |||||
benned $unstressend | |||||
használnom $unstressend | |||||
használsz $unstressend | |||||
közte $unstressend | |||||
tudnak $unstressend | |||||
megismerésére $unstressend | |||||
hasonlítgatnod $unstressend | |||||
értem $unstressend | |||||
használható $unstressend | |||||
úgytűnt $unstressend | |||||
állítható $unstressend | |||||
tűnt $unstressend | |||||
kedélyeket $unstressend | |||||
témára $unstressend | |||||
témáról $unstressend | |||||
laza $unstressend | |||||
mondjuk $unstressend | |||||
kijelenteni $unstressend | |||||
lehetősége $unstressend | |||||
kérnünk $unstressend | |||||
témában $unstressend | |||||
tűntek $unstressend | |||||
lehetnek $unstressend | |||||
megközelítésre $unstressend | |||||
szükség $unstressend | |||||
gondolunk $unstressend | |||||
egyszerű $unstressend | |||||
fordulatszám $unstressend | |||||
kapacitásról $unstressend | |||||
fogalmuk $unstressend | |||||
döntöttünk $unstressend | |||||
stílusú $unstressend | |||||
érthető $unstressend | |||||
megfogalmazott $unstressend | |||||
háttértároló $unstressend | |||||
alapú $unstressend | |||||
találhatók $unstressend | |||||
olvassák $unstressend | |||||
halljuk $unstressend | |||||
szerkezetűek $unstressend | |||||
alkatrész $unstressend | |||||
válasz $unstressend | |||||
tányér $unstressend | |||||
sebessége $unstressend | |||||
sebesség $unstressend | |||||
értelme $unstressend | |||||
eladótól $unstressend | |||||
tartalmaznak $unstressend | |||||
képesek $unstressend | |||||
egyet $unstressend | |||||
tárol $unstressend | |||||
adatot $unstressend | |||||
eltárolni $unstressend | |||||
megállapítható $unstressend | |||||
gyorsabb $unstressend | |||||
élettartama $unstressend | |||||
típus $unstressend | |||||
változat $unstressend | |||||
lassabb $unstressend | |||||
tönkre $unstressend | |||||
rövidebb $unstressend | |||||
cellán $unstressend | |||||
gyártók $unstressend | |||||
értékek $unstressend | |||||
szemléltetve $unstressend | |||||
váltakozhat $unstressend | |||||
pohár $unstressend | |||||
mennyiségét $unstressend | |||||
paraméter $unstressend | |||||
nézve $unstressend | |||||
gondolni $unstressend | |||||
elviselni $unstressend | |||||
felismerni $unstressend | |||||
oldani $unstressend | |||||
használhatatlanná $unstressend | |||||
harmadik $unstressend | |||||
működésről $unstressend | |||||
jelentené $unstressend | |||||
cella $unstressend | |||||
egyenlíteni $unstressend | |||||
optimalizálni $unstressend | |||||
celláról $unstressend | |||||
felvethet $unstressend | |||||
bele $unstressend | |||||
tárolunk $unstressend | |||||
adat $unstressend | |||||
soha $unstressend | |||||
felügyeli $unstressend | |||||
figyel $unstressend | |||||
törődnie $unstressend | |||||
számon $unstressend | |||||
használ $unstressend | |||||
kitalálható $unstressend | |||||
cellákra $unstressend | |||||
teher $unstressend | |||||
példát $unstressend | |||||
megtelítünk $unstressend | |||||
frissülnek $unstressend | |||||
találhatóak $unstressend | |||||
felületén $unstressend | |||||
tehet $unstressend | |||||
mondanánk $unstressend | |||||
megelőzésére $unstressend | |||||
minket $unstressend | |||||
érdekében $unstressend | |||||
tehetnek $unstressend | |||||
érdeme $unstressend | |||||
tárolni $unstressend | |||||
rendelkezik $unstressend | |||||
nevezik $unstressend | |||||
méretét $unstressend | |||||
életét $unstressend | |||||
árulnak $unstressend | |||||
emiatt $unstressend | |||||
tartalmaznak $unstressend | |||||
következik $unstressend | |||||
rosszabb $unstressend | |||||
hittük $unstressend | |||||
kitérünk $unstressend | |||||
adatokat $unstressend | |||||
helyükön $unstressend | |||||
kb $unstressend | |||||
blokk $unstressend | |||||
korlátozás $unstressend | |||||
történik $unstressend | |||||
volnánk $unstressend | |||||
kezdődik $unstressend | |||||
írásra $unstressend | |||||
műveleteket $unstressend | |||||
területeket $unstressend | |||||
takar $unstressend | |||||
helyzet $unstressend | |||||
szeretnénk $unstressend | |||||
lapot $unstressend | |||||
fájlunk $unstressend | |||||
fájl $unstressend | |||||
értelmeznünk $unstressend | |||||
gyűjtőneve $unstressend | |||||
elvégzik $unstressend | |||||
élettartamát $unstressend | |||||
igazság $unstressend | |||||
generációs $unstressend | |||||
típusok $unstressend | |||||
sebességét $unstressend | |||||
rendszernek $unstressend | |||||
tulajoknak $unstressend | |||||
programok $unstressend | |||||
futtatni $unstressend | |||||
eljárni $unstressend | |||||
használjuk $unstressend | |||||
tennivalónk $unstressend | |||||
létezik $unstressend | |||||
kérdés $unstressend | |||||
blokkok $unstressend | |||||
túlléptünk $unstressend | |||||
érdekesség $unstressend | |||||
léteznek $unstressend | |||||
beállítani $unstressend | |||||
átpakolni $unstressend | |||||
mértékére $unstressend | |||||
kezelik $unstressend | |||||
visszaállítását $unstressend | |||||
esetben $unstressend | |||||
valami $unstressend | |||||
kéne $unstressend | |||||
odafigyelni $unstressend | |||||
programba $unstressend | |||||
beállítás $unstressend | |||||
irányába $unstressend | |||||
erőltetik $unstressend | |||||
trendi $unstressend | |||||
módját $unstressend | |||||
nyomtatók $unstressend | |||||
monitorok $unstressend | |||||
évekből $unstressend | |||||
eszközt $unstressend | |||||
eszközöket $unstressend | |||||
régiek $unstressend | |||||
használják $unstressend | |||||
számítógépek $unstressend | |||||
László $unstressend | |||||
éves $unstressend | |||||
monitor $unstressend | |||||
szemet $unstressend | |||||
elavultak $unstressend | |||||
kezelni $unstressend | |||||
főosztájt $unstressend | |||||
selejtezés $unstressend | |||||
raktárra $unstressend | |||||
használhatatlan $unstressend | |||||
épületben $unstressend | |||||
konfiguráció $unstressend | |||||
modellek $unstressend | |||||
laptopok $unstressend | |||||
javasolják $unstressend | |||||
listán $unstressend | |||||
listában $unstressend | |||||
éles $unstressend | |||||
kompatibilisek $unstressend | |||||
szerepelnek $unstressend | |||||
95 $unstressend | |||||
fogjuk $unstressend | |||||
törekednek $unstressend | |||||
kapjon $unstressend | |||||
eleget $unstressend | |||||
kitölthető $unstressend | |||||
önöknek $unstressend | |||||
önöket $unstressend | |||||
fényesek $unstressend | |||||
szervezete $unstressend | |||||
kapuját $unstressend | |||||
manuál $unstressend | |||||
regiszter $unstressend | |||||
síp $unstressend | |||||
intonáció $unstressend | |||||
hangszert $unstressend | |||||
székházából $unstressend | |||||
szándékukat $unstressend | |||||
embereket $unstressend | |||||
plázát $unstressend | |||||
tárjuk $unstressend | |||||
társadalmat $unstressend | |||||
kérdőívét $unstressend | |||||
választani $unstressend | |||||
szakítani $unstressend | |||||
akad $unstressend | |||||
felkeresni $unstressend | |||||
oka $unstressend | |||||
kitölteni $unstressend | |||||
ellenőrzését $unstressend | |||||
vásárolt $unstressend | |||||
szokásos $unstressend | |||||
skálázták $unstressend | |||||
vehesse $unstressend | |||||
berendezések $unstressend | |||||
védelemmel $unstressend | |||||
lehetőséget $unstressend | |||||
lakók $unstressend | |||||
jelszóra $unstressend | |||||
lehessen $unstressend | |||||
kérdőívet $unstressend | |||||
rendszere $unstressend | |||||
csökkent $unstressend | |||||
csökken $unstressend | |||||
ideje $unstressend | |||||
megmondja $unstressend | |||||
sújtható $unstressend | |||||
megbüntetésére $unstressend | |||||
alkalmazzák $unstressend | |||||
kijelentik $unstressend | |||||
kérdésekre $unstressend | |||||
vonatkoznak $unstressend | |||||
döntenek $unstressend | |||||
játszana $unstressend | |||||
// word pairs | // word pairs | ||||
ø $accent | ø $accent | ||||
ß _^_DE | ß _^_DE | ||||
//… _p%ontp%ontp%ont // 3 or more dots are changed to elipsis | |||||
… _p%ontp%ontp%ont // 3 or more dots are changed to elipsis | |||||
. p%ont $max3 | . p%ont $max3 | ||||
_. pont | _. pont | ||||
* tSillAg $max3 | * tSillAg $max3 |
_í) gy (jár J | _í) gy (jár J | ||||
száze) gy (es J: | száze) gy (es J: | ||||
huszone) gy (es J: | huszone) gy (es J: | ||||
_e) gy (é_ J: | |||||
_mint-e) gy (é_ J: | |||||
.group h | .group h | ||||
h h | h h | ||||
_sz) í (vattákk i | _sz) í (vattákk i | ||||
_sz) í (vató i | _sz) í (vató i | ||||
_v) í (zi i //for example vízipipa, vízimentők beginning words need spokening i, not i: phoneme | _v) í (zi i //for example vízipipa, vízimentők beginning words need spokening i, not i: phoneme | ||||
_v) í (zió i: //But this word an exception for prewious rule | |||||
.group j | .group j | ||||
j j | j j | ||||
_fúvó) s (zene S | _fúvó) s (zene S | ||||
identitá) s (zavar S | identitá) s (zavar S | ||||
fáklyá) s (zen S | fáklyá) s (zen S | ||||
_ki) s (zombor S | |||||
.group ss | .group ss | ||||
ssz ss2 | ssz ss2 | ||||
alvá) ssz (eg Ss | alvá) ssz (eg Ss | ||||
lako) ssz (ám Ss | lako) ssz (ám Ss | ||||
_szencsége) ssz (űz Ss | _szencsége) ssz (űz Ss | ||||
ki) ssz (ekrény Ss | |||||
.group sz | .group sz | ||||
_á) tsz (orong t|s | _á) tsz (orong t|s | ||||
_á) tsz (orít t|s | _á) tsz (orít t|s | ||||
_á) tsz (olgál t|s | _á) tsz (olgál t|s | ||||
felira) ts (áv t|S | |||||
pö) tsz (en ts: | |||||
.group tt | .group tt | ||||
tt t: | tt t: |
[l/] fr | [l/] fr | ||||
l/l_@ [l/3] base | l/l_@ [l/3] base | ||||
[l/] fr | [l/] fr | ||||
l/l@ [hÖq] base | |||||
l/l@ [h–] base | |||||
[l#] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/L2_uL [l/2] base | l/L2_uL [l/2] base | ||||
l/l_3 [l/] de | l/l_3 [l/] de | ||||
l/l_4 [ll] sq | l/l_4 [ll] sq | ||||
l/la [hÖq] base | |||||
l/la [h–] base | |||||
[l#] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
[K] tn | [K] tn | ||||
l/l_a [l/3] base | l/l_a [l/3] base | ||||
[l/] fr | [l/] fr | ||||
l/le [hÖq] base | |||||
l/le [h–] base | |||||
[l#] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
[&:] af | [&:] af | ||||
l/l_front [L] sq | l/l_front [L] sq | ||||
l/l_front_ [l/4] sq | l/l_front_ [l/4] sq | ||||
l/li [hÖq] base | |||||
l/li [h–] base | |||||
[l#] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
ll/_ll [L] bg | ll/_ll [L] bg | ||||
l/l_long [l] base | l/l_long [l] base | ||||
[l] fr | [l] fr | ||||
l/lo [hÖq] base | |||||
l/lo [h–] base | |||||
[l#] base | [l#] base | ||||
[l/2] fr | [l/2] fr | ||||
[K] nso | [K] nso | ||||
l^/l_rfx [l.] base | l^/l_rfx [l.] base | ||||
[l] ru | [l] ru | ||||
[l^] ru | [l^] ru | ||||
l/lu [hÖq] base | |||||
l/lu [h–] base | |||||
[l#] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr |
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES | -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES | ||||
-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT | -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT | ||||
CXXFLAGS = -O2 -g0 -Wall -g -fexceptions -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 \ | |||||
CXXFLAGS = -O2 -Wall -fexceptions -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 \ | |||||
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT | -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT | ||||
all: espeakedit | all: espeakedit |
unsigned char c2; | unsigned char c2; | ||||
int ix; | int ix; | ||||
int sign; | int sign; | ||||
int keyword; | |||||
char *p; | char *p; | ||||
keywtab_t *pk; | keywtab_t *pk; | ||||
if(!feof(f_in)) | if(!feof(f_in)) | ||||
unget_char(c); | unget_char(c); | ||||
keyword = -1; | |||||
if(type == tSTRING) | if(type == tSTRING) | ||||
{ | { | ||||
return(0); | return(0); |
#include "synthesize.h" | #include "synthesize.h" | ||||
#include "translate.h" | #include "translate.h" | ||||
//#define OPT_FORMAT // format the text and write formatted copy to Log file | |||||
//#define OUTPUT_FORMAT | |||||
extern void Write4Bytes(FILE *f, int value); | extern void Write4Bytes(FILE *f, int value); | ||||
int HashDictionary(const char *string); | int HashDictionary(const char *string); | ||||
int all_upper_case; | int all_upper_case; | ||||
char *mnemptr; | char *mnemptr; | ||||
char *comment; | |||||
unsigned char flag_codes[100]; | unsigned char flag_codes[100]; | ||||
char encoded_ph[200]; | char encoded_ph[200]; | ||||
unsigned char bad_phoneme[4]; | unsigned char bad_phoneme[4]; | ||||
static char nullstring[] = {0}; | static char nullstring[] = {0}; | ||||
comment = NULL; | |||||
text_not_phonemes = 0; | text_not_phonemes = 0; | ||||
phonetic = word = nullstring; | phonetic = word = nullstring; | ||||
if((c == '/') && (p[1] == '/') && (multiple_words==0)) | if((c == '/') && (p[1] == '/') && (multiple_words==0)) | ||||
{ | { | ||||
c = '\n'; /* "//" treat comment as end of line */ | c = '\n'; /* "//" treat comment as end of line */ | ||||
comment = p; | |||||
} | } | ||||
switch(step) | switch(step) | ||||
if(word[0] == 0) | if(word[0] == 0) | ||||
{ | { | ||||
#ifdef OPT_FORMAT | |||||
if(comment != NULL) | |||||
fprintf(f_log,"%s",comment); | |||||
else | |||||
fputc('\n',f_log); | |||||
#endif | |||||
return(0); /* blank line */ | return(0); /* blank line */ | ||||
} | } | ||||
} | } | ||||
dict_line[0] = length; | dict_line[0] = length; | ||||
#ifdef OPT_FORMAT | |||||
spaces = 16; | |||||
for(ix=0; ix<n_flag_codes; ix++) | |||||
{ | |||||
if(flag_codes[ix] >= 100) | |||||
{ | |||||
fprintf(f_log,"?%d ",flag_codes[ix]-100); | |||||
spaces -= 3; | |||||
} | |||||
} | |||||
fprintf(f_log,"%s",word); | |||||
spaces -= strlen(word); | |||||
DecodePhonemes(encoded_ph,decoded_ph); | |||||
while(spaces-- > 0) fputc(' ',f_log); | |||||
spaces += (14 - strlen(decoded_ph)); | |||||
fprintf(f_log," %s",decoded_ph); | |||||
while(spaces-- > 0) fputc(' ',f_log); | |||||
for(ix=0; ix<n_flag_codes; ix++) | |||||
{ | |||||
if(flag_codes[ix] < 100) | |||||
fprintf(f_log," %s",lookup_mnem(mnem_flags,flag_codes[ix])); | |||||
} | |||||
if(comment != NULL) | |||||
fprintf(f_log," %s",comment); | |||||
else | |||||
fputc('\n',f_log); | |||||
#endif | |||||
return(length); | return(length); | ||||
} /* end of compile_line */ | } /* end of compile_line */ | ||||
int start; | int start; | ||||
int state=2; | int state=2; | ||||
int finish=0; | int finish=0; | ||||
int pre_bracket=0; | |||||
char buf[80]; | char buf[80]; | ||||
char output[150]; | char output[150]; | ||||
unsigned char bad_phoneme[4]; | unsigned char bad_phoneme[4]; | ||||
case ')': // end of prefix section | case ')': // end of prefix section | ||||
*p = 0; | *p = 0; | ||||
state = 1; | state = 1; | ||||
pre_bracket = 1; | |||||
copy_rule_string(buf,state); | copy_rule_string(buf,state); | ||||
p = buf; | p = buf; | ||||
break; | break; |
int vowel_posn=9; | int vowel_posn=9; | ||||
int index; | int index; | ||||
int count; | int count; | ||||
int apostrophe=0; | |||||
utf8_in(&c,word); | utf8_in(&c,word); | ||||
if((tr->letter_bits_offset > 0) && (c < 0x241)) | if((tr->letter_bits_offset > 0) && (c < 0x241)) | ||||
break; | break; | ||||
} | } | ||||
if(c == '\'') | |||||
apostrophe = 1; | |||||
else | |||||
if(!iswalpha(c)) | |||||
if((c != '\'') && !iswalpha(c)) | |||||
return(0); | return(0); | ||||
} | } | ||||
int final_ph2; | int final_ph2; | ||||
int mnem; | int mnem; | ||||
int mnem2; | int mnem2; | ||||
int post_tonic; | |||||
int post_tonic; // currently not used | |||||
int opt_length; | int opt_length; | ||||
int done; | int done; | ||||
int stressflags; | int stressflags; | ||||
{ | { | ||||
int wt; | int wt; | ||||
int max_weight = -1; | int max_weight = -1; | ||||
int prev_stressed; | |||||
// int prev_stressed; | |||||
// find the heaviest syllable, excluding the final syllable | // find the heaviest syllable, excluding the final syllable | ||||
for(ix = 1; ix < (vowel_count-1); ix++) | for(ix = 1; ix < (vowel_count-1); ix++) | ||||
if((wt = syllable_weight[ix]) >= max_weight) | if((wt = syllable_weight[ix]) >= max_weight) | ||||
{ | { | ||||
max_weight = wt; | max_weight = wt; | ||||
prev_stressed = stressed_syllable; | |||||
// prev_stressed = stressed_syllable; | |||||
stressed_syllable = ix; | stressed_syllable = ix; | ||||
} | } | ||||
} | } | ||||
// next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length | // next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length | ||||
end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f); | end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f); | ||||
if((tr->word_vowel_count == 0) && !(end_type & SUFX_P)) | |||||
if((tr->word_vowel_count == 0) && !(end_type & SUFX_P) && (tr->langopts.param[LOPT_SUFFIX] & 1)) | |||||
failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr). | failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr). | ||||
else | else | ||||
{ | { | ||||
Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */ | Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */ | ||||
unsigned char c, c2; | unsigned char c, c2; | ||||
unsigned int c12, c123; | |||||
unsigned int c12; | |||||
int wc=0; | int wc=0; | ||||
int wc_prev; | |||||
int wc_bytes; | int wc_bytes; | ||||
char *p2; /* copy of p for use in double letter chain match */ | char *p2; /* copy of p for use in double letter chain match */ | ||||
int found; | int found; | ||||
while(((c = *p) != ' ') && (c != 0)) | while(((c = *p) != ' ') && (c != 0)) | ||||
{ | { | ||||
wc_prev = wc; | |||||
wc_bytes = utf8_in(&wc,p); | wc_bytes = utf8_in(&wc,p); | ||||
if(IsAlpha(wc)) | if(IsAlpha(wc)) | ||||
any_alpha++; | any_alpha++; | ||||
/* there are some 2 byte chains for this initial letter */ | /* there are some 2 byte chains for this initial letter */ | ||||
c2 = p[1]; | c2 = p[1]; | ||||
c12 = c + (c2 << 8); /* 2 characters */ | c12 = c + (c2 << 8); /* 2 characters */ | ||||
c123 = c12 + (p[2] << 16); | |||||
g1 = tr->groups2_start[c]; | g1 = tr->groups2_start[c]; | ||||
for(g=g1; g < (g1+n); g++) | for(g=g1; g < (g1+n); g++) | ||||
if(option_phonemes == 2) | if(option_phonemes == 2) | ||||
{ | { | ||||
unsigned int flags1 = 0; | |||||
char ph_decoded[N_WORD_PHONEMES]; | char ph_decoded[N_WORD_PHONEMES]; | ||||
int textmode; | int textmode; | ||||
DecodePhonemes(phonetic,ph_decoded); | DecodePhonemes(phonetic,ph_decoded); | ||||
if(flags != NULL) | |||||
flags1 = flags[0]; | |||||
if((dictionary_flags & FLAG_TEXTMODE) == 0) | if((dictionary_flags & FLAG_TEXTMODE) == 0) | ||||
textmode = 0; | textmode = 0; |
const char *p; | const char *p; | ||||
int len; | int len; | ||||
int count; | int count; | ||||
int scores = 0; | |||||
const espeak_VOICE *v; | const espeak_VOICE *v; | ||||
const char *lang_name; | const char *lang_name; | ||||
char age_buf[12]; | char age_buf[12]; | ||||
voice_select.gender = 0; | voice_select.gender = 0; | ||||
voice_select.name = NULL; | voice_select.name = NULL; | ||||
voices = espeak_ListVoices(&voice_select); | voices = espeak_ListVoices(&voice_select); | ||||
scores = 1; | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
count++; | count++; | ||||
p += len+2; | p += len+2; | ||||
} | } | ||||
// if(scores) | |||||
// fprintf(f_out,"%3d ",v->score); | |||||
fputc('\n',f_out); | fputc('\n',f_out); | ||||
} | } | ||||
} // end of DisplayVoices | } // end of DisplayVoices | ||||
espeak_VOICE voice_select; | espeak_VOICE voice_select; | ||||
char filename[200]; | char filename[200]; | ||||
char voicename[40]; | char voicename[40]; | ||||
char voice_mbrola[20]; | |||||
char dictname[40]; | |||||
#define N_PUNCTLIST 100 | #define N_PUNCTLIST 100 | ||||
wchar_t option_punctlist[N_PUNCTLIST]; | wchar_t option_punctlist[N_PUNCTLIST]; | ||||
voicename[0] = 0; | voicename[0] = 0; | ||||
voice_mbrola[0] = 0; | |||||
dictname[0] = 0; | |||||
wavefile[0] = 0; | wavefile[0] = 0; | ||||
filename[0] = 0; | filename[0] = 0; | ||||
option_punctlist[0] = 0; | option_punctlist[0] = 0; |
ENTER("sleep_until_timeout_or_stop_request"); | ENTER("sleep_until_timeout_or_stop_request"); | ||||
int a_stop_is_required=0; | int a_stop_is_required=0; | ||||
struct timespec ts, to; | |||||
struct timespec ts; | |||||
struct timeval tv; | struct timeval tv; | ||||
int err=0; | int err=0; | ||||
clock_gettime2( &ts); | clock_gettime2( &ts); | ||||
#ifdef DEBUG_ENABLED | |||||
struct timespec to; | |||||
to.tv_sec = ts.tv_sec; | to.tv_sec = ts.tv_sec; | ||||
to.tv_nsec = ts.tv_nsec; | to.tv_nsec = ts.tv_nsec; | ||||
#endif | |||||
add_time_in_ms( &ts, time_in_ms); | add_time_in_ms( &ts, time_in_ms); | ||||
char buf_out[200]; | char buf_out[200]; | ||||
char buf_error[200]; | char buf_error[200]; | ||||
char last_listx[200]; | char last_listx[200]; | ||||
int test; | |||||
static const char *vowels1 = "aeiou"; | static const char *vowels1 = "aeiou"; | ||||
static const char *vowels2 = "aeou"; | static const char *vowels2 = "aeou"; | ||||
char *pw; | char *pw; | ||||
char *pw1; | char *pw1; | ||||
int cc; | int cc; | ||||
int ix; | |||||
int vcount; | int vcount; | ||||
int lex_stress; | int lex_stress; | ||||
int input_length; | int input_length; | ||||
FILE *f_in; | FILE *f_in; | ||||
FILE *f_out; | FILE *f_out; | ||||
FILE *f_log; | |||||
char word[80]; | char word[80]; | ||||
char word_in[80]; | char word_in[80]; | ||||
return; | return; | ||||
} | } | ||||
// sprintf(fname,"%s%c%s",path_dsource,PATHSEP,"bg_log"); | |||||
// f_log = fopen(fname,"w"); | |||||
LoadVoice("bg",0); | LoadVoice("bg",0); | ||||
progress = new wxProgressDialog(_T("Lexicon"),_T(""),input_length); | progress = new wxProgressDialog(_T("Lexicon"),_T(""),input_length); | ||||
fclose(f_in); | fclose(f_in); | ||||
fclose(f_out); | fclose(f_out); | ||||
// fclose(f_log); | |||||
CompileDictionary(path_dsource,"bg",NULL,NULL,0); | CompileDictionary(path_dsource,"bg",NULL,NULL,0); | ||||
FILE *f_in; | FILE *f_in; | ||||
FILE *f_out; | FILE *f_out; | ||||
FILE *f_log; | FILE *f_log; | ||||
FILE *f_roots; | |||||
PHONEME_TAB *ph; | PHONEME_TAB *ph; | ||||
int ph_code; | int ph_code; | ||||
int vcount; | int vcount; | ||||
int wlength; | int wlength; | ||||
int input_length; | int input_length; | ||||
int sfx; | |||||
const char *suffix; | |||||
int wlen; | |||||
int len; | |||||
int check_root; | int check_root; | ||||
char word[80]; | char word[80]; | ||||
int syllables; | int syllables; | ||||
} SUFFIX; | } SUFFIX; | ||||
#ifdef deleted | |||||
FILE *f_roots; | |||||
int sfx; | |||||
const char *suffix; | |||||
int wlen; | |||||
int len; | |||||
static SUFFIX suffixes[] = { | static SUFFIX suffixes[] = { | ||||
{NULL,0}, | {NULL,0}, | ||||
{"ичу",2}, | {"ичу",2}, | ||||
{"и",1}, | {"и",1}, | ||||
{NULL,0}}; | {NULL,0}}; | ||||
#endif | |||||
memset(counts,0,sizeof(counts)); | memset(counts,0,sizeof(counts)); | ||||
// for filtering underflow. | // for filtering underflow. | ||||
// | // | ||||
int i=0; | int i=0; | ||||
while((i<= MAX_INACTIVITY_CHECK) && !a_start_is_required) | |||||
{ | |||||
if (wave_is_busy( NULL) ) | |||||
while((i<= MAX_INACTIVITY_CHECK) && !a_start_is_required) | |||||
{ | { | ||||
i = 0; | |||||
} | |||||
if (wave_is_busy( NULL) ) | |||||
{ | |||||
i = 0; | |||||
} | |||||
else | else | ||||
{ | |||||
i++; | |||||
} | |||||
{ | |||||
i++; | |||||
} | |||||
int err=0; | |||||
struct timespec ts, to; | |||||
struct timeval tv; | |||||
clock_gettime2( &ts); | |||||
to.tv_sec = ts.tv_sec; | |||||
to.tv_nsec = ts.tv_nsec; | |||||
add_time_in_ms( &ts, INACTIVITY_TIMEOUT); | |||||
SHOW("fifo > sleep_until_start_request_or_inactivity > start sem_timedwait (start_is_required) from %d.%09lu to %d.%09lu \n", | |||||
to.tv_sec, to.tv_nsec, | |||||
ts.tv_sec, ts.tv_nsec); | |||||
while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1 | |||||
&& errno == EINTR) | |||||
{ | |||||
continue; | |||||
} | |||||
assert (gettimeofday(&tv, NULL) != -1); | |||||
SHOW("fifo > sleep_until_start_request_or_inactivity > stop sem_timedwait (start_is_required, err=%d) %d.%09lu \n", err, | |||||
tv.tv_sec, tv.tv_usec*1000); | |||||
if (err==0) | |||||
{ | |||||
a_start_is_required = 1; | |||||
int err=0; | |||||
struct timespec ts; | |||||
struct timeval tv; | |||||
clock_gettime2( &ts); | |||||
#ifdef DEBUG_ENABLED | |||||
struct timespec to; | |||||
to.tv_sec = ts.tv_sec; | |||||
to.tv_nsec = ts.tv_nsec; | |||||
#endif | |||||
add_time_in_ms( &ts, INACTIVITY_TIMEOUT); | |||||
SHOW("fifo > sleep_until_start_request_or_inactivity > start sem_timedwait (start_is_required) from %d.%09lu to %d.%09lu \n", | |||||
to.tv_sec, to.tv_nsec, | |||||
ts.tv_sec, ts.tv_nsec); | |||||
while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1 | |||||
&& errno == EINTR) | |||||
{ | |||||
continue; | |||||
} | |||||
assert (gettimeofday(&tv, NULL) != -1); | |||||
SHOW("fifo > sleep_until_start_request_or_inactivity > stop sem_timedwait (start_is_required, err=%d) %d.%09lu \n", err, | |||||
tv.tv_sec, tv.tv_usec*1000); | |||||
if (err==0) | |||||
{ | |||||
a_start_is_required = 1; | |||||
} | |||||
} | } | ||||
} | |||||
SHOW_TIME("fifo > sleep_until_start_request_or_inactivity > LEAVE"); | |||||
return a_start_is_required; | |||||
SHOW_TIME("fifo > sleep_until_start_request_or_inactivity > LEAVE"); | |||||
return a_start_is_required; | |||||
} | } | ||||
//> | //> |
int ix; | int ix; | ||||
TUNE *tune; | TUNE *tune; | ||||
int drop; | int drop; | ||||
int continuing = 0; | |||||
if(start > 0) | |||||
continuing = 1; | |||||
tune = &tunes[tune_number]; | tune = &tunes[tune_number]; | ||||
ix = start; | ix = start; | ||||
PHONEME_TAB *tph; | PHONEME_TAB *tph; | ||||
PHONEME_TAB *prev_tph; // forget across word boundary | PHONEME_TAB *prev_tph; // forget across word boundary | ||||
PHONEME_TAB *prevw_tph; // remember across word boundary | PHONEME_TAB *prevw_tph; // remember across word boundary | ||||
PHONEME_TAB *prev2_tph; // 2 tones previous | |||||
// PHONEME_TAB *prev2_tph; // 2 tones previous | |||||
PHONEME_LIST *prev_p; | PHONEME_LIST *prev_p; | ||||
int pitch_adjust = 0; // pitch gradient through the clause - inital value | int pitch_adjust = 0; // pitch gradient through the clause - inital value | ||||
int pitch_low = 0; // until it drops to this | int pitch_low = 0; // until it drops to this | ||||
int pitch_high = 0; // then reset to this | int pitch_high = 0; // then reset to this | ||||
p = &phoneme_list[0]; | |||||
// count number of stressed syllables | // count number of stressed syllables | ||||
p = &phoneme_list[0]; | p = &phoneme_list[0]; | ||||
for(ix=0; ix<n_phoneme_list; ix++, p++) | for(ix=0; ix<n_phoneme_list; ix++, p++) | ||||
} | } | ||||
prev_p = p; | prev_p = p; | ||||
prev2_tph = prevw_tph; | |||||
// prev2_tph = prevw_tph; | |||||
prevw_tph = prev_tph = tph; | prevw_tph = prev_tph = tph; | ||||
pause = 0; | pause = 0; | ||||
} | } |
double arg; | double arg; | ||||
f = -f; | f = -f; | ||||
if(f>=0) | |||||
{ | |||||
f = -1; | |||||
} | |||||
//NOTE, changes made 30.09.2011 for Reece Dunn <[email protected]> | |||||
// fix a sound spike when f=0 | |||||
/* First compute ordinary resonator coefficients */ | /* First compute ordinary resonator coefficients */ | ||||
/* Let r = exp(-pi bw t) */ | /* Let r = exp(-pi bw t) */ | ||||
arg = kt_globals.minus_pi_t * bw; | arg = kt_globals.minus_pi_t * bw; | ||||
rp->a = 1.0 - rp->b - rp->c; | rp->a = 1.0 - rp->b - rp->c; | ||||
/* Now convert to antiresonator coefficients (a'=1/a, b'=b/a, c'=c/a) */ | /* Now convert to antiresonator coefficients (a'=1/a, b'=b/a, c'=c/a) */ | ||||
rp->a = 1.0 / rp->a; | |||||
rp->c *= -rp->a; | |||||
rp->b *= -rp->a; | |||||
/* If f == 0 then rp->a gets set to 0 which makes a'=1/a set a', b' and c' to | |||||
* INF, causing an audible sound spike when triggered (e.g. apiration with the | |||||
* nasal register set to f=0, bw=0). | |||||
*/ | |||||
if (rp->a != 0) | |||||
{ | |||||
/* Now convert to antiresonator coefficients (a'=1/a, b'=b/a, c'=c/a) */ | |||||
rp->a = 1.0 / rp->a; | |||||
rp->c *= -rp->a; | |||||
rp->b *= -rp->a; | |||||
} | |||||
} | } | ||||
snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), | snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), | ||||
"dup2(): %s\n", strerror(errno)); | "dup2(): %s\n", strerror(errno)); | ||||
written = write(p_stderr[1], mbr_errorbuf, strlen(mbr_errorbuf)); | written = write(p_stderr[1], mbr_errorbuf, strlen(mbr_errorbuf)); | ||||
(void)written; // suppress 'variable not used' warning | |||||
_exit(1); | _exit(1); | ||||
} | } | ||||
snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), | snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), | ||||
"mbrola: %s\n", strerror(errno)); | "mbrola: %s\n", strerror(errno)); | ||||
written = write(2, mbr_errorbuf, strlen(mbr_errorbuf)); | written = write(2, mbr_errorbuf, strlen(mbr_errorbuf)); | ||||
(void)written; // suppress 'variable not used' warning | |||||
_exit(1); | _exit(1); | ||||
} | } | ||||
static char single_letter[10] = {0,0}; | static char single_letter[10] = {0,0}; | ||||
unsigned int dict_flags[2]; | unsigned int dict_flags[2]; | ||||
char ph_buf3[40]; | char ph_buf3[40]; | ||||
char *ptr; | |||||
ph_buf1[0] = 0; | ph_buf1[0] = 0; | ||||
len = utf8_out(letter,&single_letter[2]); | len = utf8_out(letter,&single_letter[2]); | ||||
// if the $accent flag is set for this letter, use the accents table (below) | // if the $accent flag is set for this letter, use the accents table (below) | ||||
dict_flags[1] = 0; | dict_flags[1] = 0; | ||||
ptr = &single_letter[1]; | |||||
if(Lookup(tr, &single_letter[1], ph_buf3) == 0) | if(Lookup(tr, &single_letter[1], ph_buf3) == 0) | ||||
{ | { | ||||
int decimal_count; | int decimal_count; | ||||
int max_decimal_count; | int max_decimal_count; | ||||
int decimal_mode; | int decimal_mode; | ||||
int hyphen; | |||||
int suffix_ix; | int suffix_ix; | ||||
int skipwords = 0; | int skipwords = 0; | ||||
char *p; | char *p; | ||||
// NOTE lang=hu, allow both dot and ordinal suffix, eg. "december 21.-én" | // NOTE lang=hu, allow both dot and ordinal suffix, eg. "december 21.-én" | ||||
// look for an ordinal number suffix after the number | // look for an ordinal number suffix after the number | ||||
ix++; | ix++; | ||||
hyphen = 0; | |||||
p = suffix; | p = suffix; | ||||
if(wtab[0].flags & FLAG_HYPHEN_AFTER) | if(wtab[0].flags & FLAG_HYPHEN_AFTER) | ||||
{ | { | ||||
*p++ = '-'; | *p++ = '-'; | ||||
hyphen = 1; | |||||
ix++; | ix++; | ||||
} | } | ||||
while((word[ix] != 0) && (word[ix] != ' ') && (ix < (int)(sizeof(suffix)-1))) | while((word[ix] != 0) && (word[ix] != ' ') && (ix < (int)(sizeof(suffix)-1))) |
int insert_ph = 0; | int insert_ph = 0; | ||||
PHONEME_LIST *phlist; | PHONEME_LIST *phlist; | ||||
PHONEME_TAB *ph; | PHONEME_TAB *ph; | ||||
PHONEME_TAB *prev, *next, *next2; | |||||
PHONEME_TAB *next, *next2; | |||||
int unstress_count = 0; | int unstress_count = 0; | ||||
int word_stress = 0; | int word_stress = 0; | ||||
int switched_language = 0; | int switched_language = 0; | ||||
int regression; | int regression; | ||||
int end_sourceix; | int end_sourceix; | ||||
int alternative; | int alternative; | ||||
int first_vowel=0; // first vowel in a word | |||||
PHONEME_DATA phdata; | PHONEME_DATA phdata; | ||||
int n_ph_list3; | int n_ph_list3; | ||||
PHONEME_LIST *plist3_inserted = NULL; | PHONEME_LIST *plist3_inserted = NULL; | ||||
PHONEME_LIST ph_list3[N_PHONEME_LIST]; | PHONEME_LIST ph_list3[N_PHONEME_LIST]; | ||||
static PHONEME_LIST2 ph_list2_null = {0,0,0,0,0,0}; | |||||
PHONEME_LIST2 *plist2 = &ph_list2_null; | |||||
PHONEME_LIST2 *plist2; | |||||
plist2 = ph_list2; | plist2 = ph_list2; | ||||
phlist = phoneme_list; | phlist = phoneme_list; | ||||
for(j=0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++) | for(j=0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++) | ||||
{ | { | ||||
prev = ph; | |||||
plist3 = &ph_list3[j]; | plist3 = &ph_list3[j]; | ||||
if(insert_ph != 0) | if(insert_ph != 0) | ||||
} | } | ||||
} | } | ||||
if(ph->type == phVOWEL) | |||||
first_vowel = 0; | |||||
if((plist3+1)->synthflags & SFLAG_LENGTHEN) | if((plist3+1)->synthflags & SFLAG_LENGTHEN) | ||||
{ | { | ||||
static char types_double[] = {phFRICATIVE,phVFRICATIVE,phNASAL,phLIQUID,0}; | static char types_double[] = {phFRICATIVE,phVFRICATIVE,phNASAL,phLIQUID,0}; |
int cbuf[4]; | int cbuf[4]; | ||||
int ix; | int ix; | ||||
int n_bytes; | int n_bytes; | ||||
unsigned char m; | |||||
static int ungot2 = 0; | static int ungot2 = 0; | ||||
static const unsigned char mask[4] = {0xff,0x1f,0x0f,0x07}; | static const unsigned char mask[4] = {0xff,0x1f,0x0f,0x07}; | ||||
static const unsigned char mask2[4] = {0,0x80,0x20,0x30}; | |||||
if((c1 = ungot_char) != 0) | if((c1 = ungot_char) != 0) | ||||
{ | { | ||||
if((ix = n_bytes) > 0) | if((ix = n_bytes) > 0) | ||||
{ | { | ||||
c = c1 & mask[ix]; | c = c1 & mask[ix]; | ||||
m = mask2[ix]; | |||||
while(ix > 0) | while(ix > 0) | ||||
{ | { | ||||
if((c2 = cbuf[ix] = GetC_get()) == 0) | if((c2 = cbuf[ix] = GetC_get()) == 0) | ||||
GetC_unget(c2); | GetC_unget(c2); | ||||
break; | break; | ||||
} | } | ||||
m = 0x80; | |||||
c = (c << 6) + (c2 & 0x3f); | c = (c << 6) + (c2 & 0x3f); | ||||
ix--; | ix--; | ||||
} | } | ||||
sp->voice_variant_number = v->variant; | sp->voice_variant_number = v->variant; | ||||
sp->voice_age = v->age; | sp->voice_age = v->age; | ||||
sp->voice_gender = v->gender; | sp->voice_gender = v->gender; | ||||
if(memcmp(variant_name, "!v/", 3) == 0) | |||||
variant_name += 3;// strip variant directory name | |||||
strncpy0(base_voice_variant_name, variant_name, sizeof(base_voice_variant_name)); | strncpy0(base_voice_variant_name, variant_name, sizeof(base_voice_variant_name)); | ||||
memcpy(&base_voice, ¤t_voice_selected, sizeof(base_voice)); | memcpy(&base_voice, ¤t_voice_selected, sizeof(base_voice)); | ||||
} | } | ||||
int punct_data = 0; | int punct_data = 0; | ||||
int is_end_clause; | int is_end_clause; | ||||
int announced_punctuation = 0; | int announced_punctuation = 0; | ||||
int prev_announced_punctuation; | |||||
int stressed_word = 0; | int stressed_word = 0; | ||||
int end_clause_after_tag = 0; | int end_clause_after_tag = 0; | ||||
int end_clause_index = 0; | int end_clause_index = 0; | ||||
linelength = 0; | linelength = 0; | ||||
} | } | ||||
prev_announced_punctuation = announced_punctuation; | |||||
announced_punctuation = 0; | announced_punctuation = 0; | ||||
if((phoneme_mode==0) && (sayas_mode==0)) | if((phoneme_mode==0) && (sayas_mode==0)) |
const char *p; | const char *p; | ||||
int len; | int len; | ||||
int count; | int count; | ||||
int scores = 0; | |||||
const espeak_VOICE *v; | const espeak_VOICE *v; | ||||
const char *lang_name; | const char *lang_name; | ||||
char age_buf[12]; | char age_buf[12]; | ||||
voice_select.gender = 0; | voice_select.gender = 0; | ||||
voice_select.name = NULL; | voice_select.name = NULL; | ||||
voices = espeak_ListVoices(&voice_select); | voices = espeak_ListVoices(&voice_select); | ||||
scores = 1; | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
count++; | count++; | ||||
p += len+2; | p += len+2; | ||||
} | } | ||||
// if(scores) | |||||
// fprintf(f_out,"%3d ",v->score); | |||||
fputc('\n',f_out); | fputc('\n',f_out); | ||||
} | } | ||||
} // end of DisplayVoices | } // end of DisplayVoices | ||||
espeak_VOICE voice_select; | espeak_VOICE voice_select; | ||||
char filename[200]; | char filename[200]; | ||||
char voicename[40]; | char voicename[40]; | ||||
char dictname[40]; | |||||
voicename[0] = 0; | voicename[0] = 0; | ||||
mbrola_name[0] = 0; | mbrola_name[0] = 0; | ||||
dictname[0] = 0; | |||||
wavefile[0] = 0; | wavefile[0] = 0; | ||||
filename[0] = 0; | filename[0] = 0; | ||||
option_linelength = 0; | option_linelength = 0; |
case AUDIO_OUTPUT_PLAYBACK: | case AUDIO_OUTPUT_PLAYBACK: | ||||
{ | { | ||||
int event_type=0; | int event_type=0; | ||||
int event_data=0; | |||||
if(event) | if(event) | ||||
{ | { | ||||
event_type = event->type; | event_type = event->type; | ||||
event_data = event->id.number; | |||||
} | } | ||||
if(event_type == espeakEVENT_SAMPLERATE) | if(event_type == espeakEVENT_SAMPLERATE) |
int keyfr; | int keyfr; | ||||
int control; | int control; | ||||
int number; | int number; | ||||
double value; | |||||
SpectFrame *sf; | SpectFrame *sf; | ||||
peak_t *pk; | peak_t *pk; | ||||
// static short pk_inc1[N_PEAKS] = {2,2,2,5,5,5,5,5,5}; | // static short pk_inc1[N_PEAKS] = {2,2,2,5,5,5,5,5,5}; | ||||
display = 3; | display = 3; | ||||
break; | break; | ||||
case 0x1052: // CTRL-R | |||||
value = sf->GetRms(spectseq->amplitude); | |||||
break; | |||||
case 0x1053: // CTRL-S | case 0x1053: // CTRL-S | ||||
Save(savepath); | Save(savepath); | ||||
break; | break; | ||||
else | else | ||||
path_spectload2 = path.GetPath(); | path_spectload2 = path.GetPath(); | ||||
// Make another frame, containing a canvas | |||||
// Make another frame, containing a canvas | |||||
GetClientSize(&width, &height); | GetClientSize(&width, &height); | ||||
MyChild *subframe = new MyChild(myframe, _T("Spectrum"), | MyChild *subframe = new MyChild(myframe, _T("Spectrum"), | ||||
wxPoint(10, 0), wxSize(500, height), | wxPoint(10, 0), wxSize(500, height), |
int n_cycles = 0; | int n_cycles = 0; | ||||
int x; | int x; | ||||
CYCLE cy; | CYCLE cy; | ||||
int pos; | |||||
/* count number of cycles */ | /* count number of cycles */ | ||||
while(!stream.Eof()) | while(!stream.Eof()) | ||||
{ | { | ||||
pos = stream.TellI(); | |||||
stream.TellI(); | |||||
stream.Read(&cy,44); | stream.Read(&cy,44); | ||||
pos = stream.TellI(); | |||||
stream.TellI(); | |||||
if(stream.Eof()) break; | if(stream.Eof()) break; | ||||
n_cycles++; | n_cycles++; | ||||
float sum_length=0; | float sum_length=0; | ||||
float prev_length=0; | float prev_length=0; | ||||
int first; | int first; | ||||
int pbase; | |||||
char *fname_speech; | char *fname_speech; | ||||
SpectFrame *sp1 = NULL; | SpectFrame *sp1 = NULL; | ||||
SpectFrame *sp2; | SpectFrame *sp2; | ||||
} | } | ||||
total_length = int(sum_length); | total_length = int(sum_length); | ||||
pbase = voice->pitch_base >> 12; | |||||
if((start==end) || (total_length == 0)) | if((start==end) || (total_length == 0)) | ||||
{ | { | ||||
int y; | int y; | ||||
peak_t peaks0[N_PEAKS]; | peak_t peaks0[N_PEAKS]; | ||||
peak_t peaks1[N_PEAKS]; | peak_t peaks1[N_PEAKS]; | ||||
int ipitch; | |||||
int pbase; | |||||
char *fname_speech; | char *fname_speech; | ||||
int synthesizer_type = 0; | int synthesizer_type = 0; | ||||
SpeakNextClause(NULL,NULL,2); // stop speaking file | SpeakNextClause(NULL,NULL,2); // stop speaking file | ||||
length = duration; | length = duration; | ||||
ipitch = int(pitch) << 16; | |||||
if(length==0) | if(length==0) | ||||
length = 200; // default length, mS | length = 200; // default length, mS | ||||
len_samples = (length * samplerate) / 1000; | len_samples = (length * samplerate) / 1000; | ||||
pbase = voice->pitch_base >> 12; | |||||
SetPitch(len_samples + 50,pitche.env,9,44); | SetPitch(len_samples + 50,pitche.env,9,44); | ||||
fname_speech = WavFileName(); | fname_speech = WavFileName(); |
PHONEME_TAB *ph_prev; | PHONEME_TAB *ph_prev; | ||||
PHONEME_LIST *p; | PHONEME_LIST *p; | ||||
PHONEME_LIST *next; | PHONEME_LIST *next; | ||||
PHONEME_LIST *prev; | |||||
PHONEME_DATA phdata; | PHONEME_DATA phdata; | ||||
FMT_PARAMS fmtp; | FMT_PARAMS fmtp; | ||||
int pause = 0; | int pause = 0; | ||||
p = &plist[phix]; | p = &plist[phix]; | ||||
next = &plist[phix+1]; | next = &plist[phix+1]; | ||||
prev = &plist[phix-1]; | |||||
ph = p->ph; | ph = p->ph; | ||||
ph_prev = plist[phix-1].ph; | ph_prev = plist[phix-1].ph; | ||||
ph_next = plist[phix+1].ph; | ph_next = plist[phix+1].ph; |
#include "translate.h" | #include "translate.h" | ||||
#include "wave.h" | #include "wave.h" | ||||
const char *version_string = "1.45.44 16.Sep.11"; | |||||
const char *version_string = "1.45.45 07.Oct.11"; | |||||
const int version_phdata = 0x014500; | const int version_phdata = 0x014500; | ||||
int option_device_number = -1; | int option_device_number = -1; |
unsigned char *pitch_env=NULL; | unsigned char *pitch_env=NULL; | ||||
unsigned char *amp_env; | unsigned char *amp_env; | ||||
PHONEME_TAB *ph; | PHONEME_TAB *ph; | ||||
PHONEME_TAB *prev_ph; | |||||
static int sourceix=0; | static int sourceix=0; | ||||
PHONEME_DATA phdata; | PHONEME_DATA phdata; | ||||
if(p->ph->phflags & phTRILL) | if(p->ph->phflags & phTRILL) | ||||
modulation = 5; | modulation = 5; | ||||
prev_ph = prev->ph; | |||||
// if(p->newword) | |||||
// prev_ph = phoneme_tab[phonPAUSE]; // pronounce fully at the start of a word | |||||
if(!(p->synthflags & SFLAG_SEQCONTINUE)) | if(!(p->synthflags & SFLAG_SEQCONTINUE)) | ||||
{ | { | ||||
DoAmplitude(p->amp,NULL); | DoAmplitude(p->amp,NULL); |
tr->langopts.stress_rule = 7; // stress on the last syllable, before any explicitly unstressed syllable | tr->langopts.stress_rule = 7; // stress on the last syllable, before any explicitly unstressed syllable | ||||
tr->langopts.stress_flags = 0x20; //no automatic secondary stress | tr->langopts.stress_flags = 0x20; //no automatic secondary stress | ||||
tr->langopts.param[LOPT_SUFFIX] = 1; | |||||
if(name2 == L('a','z')) | if(name2 == L('a','z')) | ||||
{ | { |
int prefix_stress; | int prefix_stress; | ||||
char *wordx; | char *wordx; | ||||
char phonemes[N_WORD_PHONEMES]; | char phonemes[N_WORD_PHONEMES]; | ||||
char *ph_limit; | |||||
char prefix_phonemes[N_WORD_PHONEMES]; | char prefix_phonemes[N_WORD_PHONEMES]; | ||||
char unpron_phonemes[N_WORD_PHONEMES]; | char unpron_phonemes[N_WORD_PHONEMES]; | ||||
char end_phonemes[N_WORD_PHONEMES]; | char end_phonemes[N_WORD_PHONEMES]; | ||||
unpron_phonemes[0] = 0; | unpron_phonemes[0] = 0; | ||||
prefix_phonemes[0] = 0; | prefix_phonemes[0] = 0; | ||||
end_phonemes[0] = 0; | end_phonemes[0] = 0; | ||||
ph_limit = &phonemes[N_WORD_PHONEMES]; | |||||
if(tr->data_dictlist == NULL) | if(tr->data_dictlist == NULL) | ||||
{ | { | ||||
int prev_in; | int prev_in; | ||||
int prev_out=' '; | int prev_out=' '; | ||||
int prev_out2; | int prev_out2; | ||||
int prev_in2=0; | |||||
int prev_in_save=0; | int prev_in_save=0; | ||||
int next_in; | int next_in; | ||||
int next_in_nbytes; | int next_in_nbytes; | ||||
char *p; | char *p; | ||||
int j, k; | int j, k; | ||||
int n_digits; | int n_digits; | ||||
int individual_digits; | |||||
int charix_top=0; | int charix_top=0; | ||||
short charix[N_TR_SOURCE+4]; | short charix[N_TR_SOURCE+4]; | ||||
else | else | ||||
if(source_index > 0) | if(source_index > 0) | ||||
{ | { | ||||
prev_in2 = prev_in; | |||||
utf8_in2(&prev_in,&source[source_index-1],1); // prev_in = source[source_index-1]; | utf8_in2(&prev_in,&source[source_index-1],1); // prev_in = source[source_index-1]; | ||||
} | } | ||||
pn = &number_buf[1]; | pn = &number_buf[1]; | ||||
nx = n_digits; | nx = n_digits; | ||||
nw = 0; | nw = 0; | ||||
individual_digits = 0; | |||||
if((n_digits > tr->langopts.max_digits) || (word[0] == '0')) | if((n_digits > tr->langopts.max_digits) || (word[0] == '0')) | ||||
words[ix].flags |= FLAG_INDIVIDUAL_DIGITS; | words[ix].flags |= FLAG_INDIVIDUAL_DIGITS; |
#define N_LOPTS 19 | |||||
#define N_LOPTS 20 | |||||
#define LOPT_DIERESES 1 | #define LOPT_DIERESES 1 | ||||
// 1=remove [:] from unstressed syllables, 2= remove from unstressed or non-penultimate syllables | // 1=remove [:] from unstressed syllables, 2= remove from unstressed or non-penultimate syllables | ||||
// bit 4=0, if stress < 4, bit 4=1, if not the highest stress in the word | // bit 4=0, if stress < 4, bit 4=1, if not the highest stress in the word | ||||
// recognize long vowels (0 = don't recognize) | // recognize long vowels (0 = don't recognize) | ||||
#define LOPT_LONG_VOWEL_THRESHOLD 18 | #define LOPT_LONG_VOWEL_THRESHOLD 18 | ||||
// bit 0: Don't allow suffices if there is no previous syllable | |||||
#define LOPT_SUFFIX 19 | |||||
// stress_rule | // stress_rule | ||||
#define STRESSPOSN_1L 0 // 1st syllable | #define STRESSPOSN_1L 0 // 1st syllable |
int n; | int n; | ||||
int value; | int value; | ||||
int value2; | int value2; | ||||
int error = 0; | |||||
int langix = 0; | int langix = 0; | ||||
int tone_only = control & 2; | int tone_only = control & 2; | ||||
int language_set = 0; | int language_set = 0; | ||||
} | } | ||||
voice->phoneme_tab_ix = ix; | voice->phoneme_tab_ix = ix; | ||||
new_translator->phoneme_tab_ix = ix; | new_translator->phoneme_tab_ix = ix; | ||||
error = LoadDictionary(new_translator, new_dictionary, control & 4); | |||||
LoadDictionary(new_translator, new_dictionary, control & 4); | |||||
if(dictionary_name[0]==0) | if(dictionary_name[0]==0) | ||||
return(NULL); // no dictionary loaded | return(NULL); // no dictionary loaded | ||||
int hash; | int hash; | ||||
char *p; | char *p; | ||||
unsigned int *pw; | unsigned int *pw; | ||||
char *start; | |||||
char *next; | char *next; | ||||
unsigned char c; | unsigned char c; | ||||
int count = 0; | int count = 0; | ||||
if(c == RULE_PHONEMES) | if(c == RULE_PHONEMES) | ||||
{ | { | ||||
ignore = 0; | ignore = 0; | ||||
start = p; | |||||
p++; | p++; | ||||
while((c = *p) != 0) | while((c = *p) != 0) | ||||
{ | { | ||||
int colour; | int colour; | ||||
int voice_found; | int voice_found; | ||||
PHONEME_PROG_LOG *prog_log_table; | PHONEME_PROG_LOG *prog_log_table; | ||||
PHONEME_PROG_LOG *prog_log_end; | |||||
PHONEME_PROG_LOG *found_prog; | PHONEME_PROG_LOG *found_prog; | ||||
PHONEME_PROG_LOG this_prog; | PHONEME_PROG_LOG this_prog; | ||||
char dirname[sizeof(path_source)+20]; | char dirname[sizeof(path_source)+20]; | ||||
return; | return; | ||||
ix = fread(prog_log_table, 1, ix, f_prog_log); | ix = fread(prog_log_table, 1, ix, f_prog_log); | ||||
fclose(f_prog_log); | fclose(f_prog_log); | ||||
prog_log_end = prog_log_table + ix; | |||||
n_prog_log = ix / sizeof(PHONEME_PROG_LOG); | n_prog_log = ix / sizeof(PHONEME_PROG_LOG); | ||||
progress = new wxProgressDialog(_T("Vowel charts"),_T(""),n_phoneme_tables); | progress = new wxProgressDialog(_T("Vowel charts"),_T(""),n_phoneme_tables); |
if (deviceInfo) | if (deviceInfo) | ||||
{ | { | ||||
double aLatency = deviceInfo->defaultLowOutputLatency; | double aLatency = deviceInfo->defaultLowOutputLatency; | ||||
double aCoeff = round(0.100 / aLatency); | |||||
// double aCoeff = round(0.100 / aLatency); | |||||
// myOutputParameters.suggestedLatency = aCoeff * aLatency; // to avoid glitches ? | // myOutputParameters.suggestedLatency = aCoeff * aLatency; // to avoid glitches ? | ||||
myOutputParameters.suggestedLatency = aLatency; // for faster response ? | myOutputParameters.suggestedLatency = aLatency; // for faster response ? | ||||
SHOW("Device=%d, myOutputParameters.suggestedLatency=%f, aCoeff=%f\n", | SHOW("Device=%d, myOutputParameters.suggestedLatency=%f, aCoeff=%f\n", |