git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@159 d46cf337-b52f-0410-862d-fd96e6ae7743master
@@ -0,0 +1,127 @@ | |||
// This file is UTF8 encoded | |||
// Spelling-to-phoneme words for Kurdish | |||
_0 s'Ifr | |||
_1 j'Ek | |||
_2 d'U | |||
_3 s'e | |||
_4 dZ'ar | |||
_5 p'endZ | |||
_6 S'ES | |||
_7 h'Eft | |||
_8 h'EjSt | |||
_9 n'Eh | |||
_10 d'Eh | |||
_11 jazd'E# | |||
_12 danzd'E# | |||
_13 sezd'E# | |||
_14 tSaRd'E# | |||
_15 panzd'E# | |||
_16 Sanzd'E# | |||
_17 hIvd'Eh | |||
_18 hIZd'Eh | |||
_19 nozd'Eh | |||
_2X b'Ist | |||
_3X s'i | |||
_4X tS'Il | |||
_5X pendZ'i | |||
_6X S'est | |||
_7X hEft'e | |||
_8X heSt'e | |||
_9X n'od | |||
_0C s'Ed | |||
_1C s'Ed | |||
_0M1 hEz'ar | |||
_1M1 hEz'ar | |||
_0M2 mIl'jon | |||
_1M2 mIl'jon | |||
_0and _u | |||
_dpt _xal | |||
_?? tipa | |||
_cap mezin // or "ya mezin" after the letter | |||
// characters | |||
// letter names | |||
_a a | |||
b be | |||
c dZe | |||
ç tSe | |||
d de | |||
_e E | |||
_ê e | |||
f fe | |||
g ge | |||
h he | |||
_i I | |||
_î i | |||
j Ze | |||
k ke | |||
l le | |||
m me | |||
n ne | |||
_o o | |||
p pe | |||
q qe | |||
r Re | |||
s se | |||
ş Se | |||
t te | |||
_u U | |||
_û u | |||
v ve | |||
w we | |||
x xe | |||
y je | |||
z ze | |||
_, behnok | |||
_. xal | |||
_: dZotxal | |||
_; xalbehnok | |||
_- bEndIk | |||
_? pIRsniS'an | |||
_! banES'an | |||
% sEde | |||
* steRk | |||
// function words | |||
û $u+ $pause | |||
a $u+ | |||
ê $u+ | |||
// pronouns | |||
ez $u+ | |||
te $u+ | |||
wê $u+ | |||
wî $u+ | |||
me $u+ | |||
we $u+ | |||
wan $u+ | |||
bes $pause | |||
an $u $pause | |||
anji $u $pause | |||
ên $u | |||
ya $u | |||
yê $u | |||
yan $u | |||
yên $u | |||
ji $u | |||
bi $u | |||
re $u | |||
di $u | |||
de $u | |||
kir $u | |||
got $u | |||
// abbreviations | |||
hwd hEr||wEki||dIn | |||
// pronunciation exceptions |
@@ -0,0 +1,115 @@ | |||
// Kurdish translation rules | |||
// This file is UTF-8 encoded | |||
.L01 î iy ê ew ey // front vowels | |||
.group a | |||
a a | |||
@) a (_S1 %a | |||
@) an (_S2 %an | |||
.group b | |||
b b | |||
.group c | |||
c dZ | |||
.group ç | |||
ç tS | |||
.group d | |||
d d | |||
.group e | |||
e E | |||
e (_ E# | |||
ew eU | |||
ey eI | |||
.group ê | |||
ê e | |||
@) ê (_S1 %e | |||
@) ên (_S2 %en | |||
.group f | |||
f f | |||
.group g | |||
g g | |||
g (L01 J | |||
.group h | |||
h h | |||
.group i | |||
i I | |||
.group î | |||
î i | |||
.group j | |||
j Z | |||
.group k | |||
k k | |||
k (L01 c | |||
.group l | |||
l l | |||
.group m | |||
m m | |||
.group n | |||
n n | |||
.group o | |||
o o | |||
.group p | |||
p p | |||
.group q | |||
q q | |||
.group r | |||
r R | |||
.group s | |||
s s | |||
.group ş | |||
ş S | |||
.group t | |||
t t | |||
.group u | |||
u U | |||
.group û | |||
û u | |||
.group v | |||
v v | |||
.group w | |||
w w | |||
.group x | |||
x x | |||
.group y | |||
y j | |||
.group z | |||
z z | |||
.group | |||
ö I: | |||
ü y | |||
$ dUlar |
@@ -1,4 +1,4 @@ | |||
49 phoneme tables | |||
47 phoneme tables | |||
new total | |||
base 98 98 | |||
base2 24 117 | |||
@@ -39,7 +39,7 @@ | |||
grc 12 122 | |||
sv 25 120 | |||
no 28 124 | |||
is 32 123 | |||
is 33 124 | |||
vi 42 136 | |||
zhy 40 131 | |||
zh 65 148 | |||
@@ -47,8 +47,6 @@ | |||
tr 18 122 | |||
ku 17 121 | |||
id 14 119 | |||
ja 7 103 | |||
rw 12 122 | |||
Data file Used by | |||
b/b [b] base | |||
@@ -576,14 +574,17 @@ ufric/s_ [s] base | |||
[s] es | |||
[s#] pt | |||
[z;] ro | |||
[s2] is | |||
ufric/s! [s] base | |||
[s2] fi | |||
[s] fr | |||
[s2] hu | |||
[s] es | |||
[s#] pt | |||
[s2] is | |||
ufric/s_continue [s2] fi | |||
[s2] hu | |||
[s2] is | |||
ufric/sh [S] base | |||
[S] fr | |||
[s#] pt_pt | |||
@@ -696,7 +697,7 @@ ustop/p_ [p] base | |||
[p2] fr | |||
[ph] hi | |||
[ph] zh | |||
ustop/percus10 [(X1] base | |||
ustop/percus10 [(X1)] base | |||
ustop/pl [p] base | |||
[p] base2 | |||
[p] fi | |||
@@ -789,7 +790,7 @@ ustop/tsh_ [tS] base | |||
ustop/t_short [t.] hi | |||
[t] sk | |||
[t] el | |||
ustop/tsh_pzd [tS;] zh | |||
ustop/tsh_pzd [tS;h] zh | |||
ustop/tsh_pzd_unasp [tS;] zh | |||
ustop/tsh_sr [tS] sr | |||
ustop/ts_pzd [tS;] base | |||
@@ -802,7 +803,7 @@ ustop/ts_pzd2 [c] hi | |||
[c] hu | |||
ustop/t_sr [d] sr | |||
[t] sr | |||
ustop/ts_rfx [ts.] zh | |||
ustop/ts_rfx [ts.h] zh | |||
ustop/ts_rfx_unasp [ts.] zh | |||
ustop/ts_sr [tS;] sr | |||
[dZ;] sr | |||
@@ -1028,9 +1029,9 @@ vnasal/a#_n [&~] pt | |||
vnasal/a#u_n [&U~] pt | |||
[&U~] pt_pt | |||
vnasal/ee_n [E~] en | |||
[a] en_us | |||
[E~] fr_ca | |||
vnasal/ee_n2 [E~] hi | |||
vnasal/ee_n2 [a] en_us | |||
[E~] hi | |||
[E~] pl | |||
[&~] pt_pt | |||
vnasal/e_n [e~] af | |||
@@ -1190,15 +1191,12 @@ vowel/a [a] en_n | |||
[a] it | |||
[a] zh | |||
[a] id | |||
[a] ja | |||
vowel/a# [a/] base2 | |||
[a2] en_sc | |||
[a2] en_wi | |||
[&] sr | |||
[&] pt | |||
[&/] pt | |||
[a#] rw | |||
[a/] rw | |||
vowel/a_2 [a] base2 | |||
[a] en_wi | |||
[A:] en_wi | |||
@@ -1209,7 +1207,6 @@ vowel/a_2 [a] base2 | |||
[a] pt_pt | |||
[a] ro | |||
[a:] vi | |||
[a] rw | |||
vowel/a#_2 [&] hr | |||
[a2] sv | |||
[&] is | |||
@@ -1294,8 +1291,6 @@ vowel/e [e] base2 | |||
[e] grc | |||
[e] vi | |||
[e] id | |||
[e] rw | |||
[e#] rw | |||
vowel/e# [I] en_sc | |||
[I2] en_sc | |||
vowel/e_2 [eI] en_sc | |||
@@ -1350,7 +1345,6 @@ vowel/e_mid [E] en_rp | |||
[E] tr | |||
[E] id | |||
[E2] id | |||
[e] ja | |||
vowel/e_mid2 [E] af | |||
[E] de | |||
[E2] de | |||
@@ -1388,9 +1382,6 @@ vowel/i [i] base2 | |||
[i] zhy | |||
[i] zh | |||
[i] sw | |||
[i] ja | |||
[i] rw | |||
[i#] rw | |||
vowel/i# [i] en_rp | |||
[y:] cy | |||
vowel/i_2 [i:] en_rp | |||
@@ -1486,8 +1477,6 @@ vowel/o [o] base2 | |||
[o] grc | |||
[o:] sv | |||
[o] id | |||
[o] rw | |||
[o#] rw | |||
vowel/o_2 [o:] cy | |||
[o:] hi | |||
[o:] hu | |||
@@ -1525,7 +1514,6 @@ vowel/oo [O:] en_sc | |||
[o] zhy | |||
[O] tr | |||
[O] id | |||
[o] ja | |||
vowel/oo_1 [O:] en_n | |||
[O:] en_rp | |||
[O@] en_rp | |||
@@ -1620,8 +1608,6 @@ vowel/u_bck [u] base2 | |||
[u] is | |||
[u] zhy | |||
[u] zh | |||
[u] rw | |||
[u#] rw | |||
vowel/u_bck2 [u:] la | |||
vowel/u_fnt [u:] en_rp | |||
vowel/uu [U] en | |||
@@ -1642,7 +1628,6 @@ vowel/uu_bck [U] en_n | |||
[U] pt | |||
[U] no | |||
[u] zhy | |||
vowel/u_unr [u] ja | |||
vowel/V [3] en_sc | |||
vowel/V_2 [V] en | |||
[a] af | |||
@@ -1794,7 +1779,7 @@ vwl_ru/u [u] ru | |||
vwl_ru/u# [u#] ru | |||
vwl_ru/u#u [u"] ru | |||
vwl_sv/r_sv3 [r] sv | |||
vwl_zh/aang [aan] zhy | |||
vwl_zh/aang [aang] zhy | |||
vwl_zh/aau [Au] zh | |||
vwl_zh/a_n [a] zh | |||
vwl_zh/ang [ang] zhy | |||
@@ -1805,7 +1790,7 @@ vwl_zh/ie [iE] zh | |||
vwl_zh/ing [ing] zhy | |||
vwl_zh/iou [iou] zh | |||
vwl_zh/ng [ng] zhy | |||
vwl_zh/oeng [oen] zhy | |||
vwl_zh/oeng [oeng] zhy | |||
vwl_zh/ong [ong] zhy | |||
vwl_zh/uaa [uA] zh | |||
vwl_zh/uai [uai] zh |
@@ -29,9 +29,9 @@ phoneme a | |||
vowel starttype (a) endtype (@) | |||
length 210 | |||
formants vwl_en_us/a | |||
before n vnasal/ee_n | |||
before N vnasal/ee_n | |||
before m vnasal/ee_n | |||
before n vnasal/ee_n2 | |||
before N vnasal/ee_n2 | |||
before m vnasal/ee_n2 | |||
reduceto a2 0 | |||
endphoneme | |||
@@ -262,3 +262,16 @@ phoneme v // no fricative noise | |||
endphoneme | |||
phoneme s2 // 2nd part of geminated s | |||
vls alv frc sibilant | |||
vowelin f1=0 f2=1700 -300 300 f3=-100 80 | |||
vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 | |||
lengthmod 3 | |||
wave ufric/s_continue | |||
before _ ufric/s_ | |||
before p ufric/s! | |||
before t ufric/s! | |||
before k ufric/s! | |||
switchvoicing z | |||
endphoneme | |||
@@ -70,20 +70,20 @@ endphoneme | |||
phoneme u | |||
vowel starttype (u) endtype (u) | |||
length 130 | |||
length 110 | |||
formants vowel/u | |||
reduceto U 4 | |||
endphoneme | |||
phoneme U | |||
vowel starttype (u) endtype (u) | |||
length 130 | |||
length 110 | |||
formants vowel/u#_3 | |||
endphoneme | |||
phoneme u: | |||
vowel starttype (u) endtype (u) | |||
length 270 | |||
length 250 | |||
formants vowel/u | |||
endphoneme | |||
@@ -1274,9 +1274,3 @@ include ph_kurdish | |||
phonemetable id base2 | |||
include ph_indonesian | |||
phonemetable ja base | |||
include ph_japanese | |||
phonemetable rw base2 | |||
include ph_kinyarwanda | |||
@@ -2,7 +2,7 @@ | |||
[Setup] | |||
AppName=eSpeak | |||
AppVerName=eSpeak version 1.32 | |||
AppVerName=eSpeak version 1.33 | |||
AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details). | |||
WindowVisible=yes | |||
@@ -1,7 +1,7 @@ | |||
[Setup] | |||
AppName=eSpeakEdit | |||
AppVerName=eSpeakEdit version 1.32 | |||
AppVerName=eSpeakEdit version 1.33 | |||
DefaultDirName={pf}\eSpeak | |||
DefaultGroupName=eSpeak | |||
OutputBaseFilename=setup_espeakedit |
@@ -1,4 +1,4 @@ | |||
# removed -fno-exceptions because it caused problems with stdio library on some platforms | |||
# remove -fno-exceptions because it caused problems with stdio library on some platforms (ARM) | |||
PREFIX=/ | |||
BINDIR=$(PREFIX)/usr/bin | |||
@@ -6,7 +6,7 @@ INCDIR=$(PREFIX)/usr/include/espeak | |||
LIBDIR=$(PREFIX)/usr/lib | |||
DATADIR=$(PREFIX)/usr/share/espeak-data | |||
RELEASE = 1.31 | |||
RELEASE = 1.33 | |||
BIN_NAME = speak | |||
BIN2_NAME = espeak | |||
LIB_NAME = libespeak.so | |||
@@ -68,7 +68,7 @@ all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) | |||
mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG) | |||
.cpp.o: | |||
$(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c $< | |||
$(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $< | |||
$(BIN_NAME): $(OBJS1) | |||
$(CXX) -o $@ $(OBJS1) $(LIBS1) | |||
@@ -80,7 +80,7 @@ $(BIN2_NAME): $(OBJS3) $(LIB_NAME) | |||
x_%.o: %.cpp | |||
$(CXX) $(CXXFLAGS) -Wall -fpic -pedantic \ | |||
-I. -D LIBRARY -c $< -o x_$*.o | |||
-I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o | |||
$(LIB_NAME): $(OBJS2) | |||
$(CXX) -shared $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2) |
@@ -36,6 +36,11 @@ | |||
#include "voice.h" | |||
#include "spect.h" | |||
#ifdef PLATFORM_POSIX | |||
#include <unistd.h> | |||
#endif | |||
#define tNUMBER 1 | |||
#define tSTRING 2 | |||
@@ -742,6 +747,7 @@ int Compile::LoadWavefile(FILE *f, const char *fname) | |||
int resample_wav = 0; | |||
char fname_temp[100]; | |||
int scale_factor=0; | |||
int fd_temp; | |||
char command[sizeof(path_source)+200]; | |||
fseek(f,24,SEEK_SET); | |||
@@ -762,12 +768,16 @@ int Compile::LoadWavefile(FILE *f, const char *fname) | |||
Error("Not mono: ",fname); | |||
} | |||
#else | |||
sprintf(fname_temp,"%s.wav",tmpnam(NULL)); | |||
sprintf(command,"sox \"%s%s.wav\" -r %d -c 1 -w %s polyphase\n",path_source,fname,samplerate,fname_temp); | |||
if(system(command) < 0) | |||
strcpy(fname_temp,"/tmp/espeakXXXXXX"); | |||
if((fd_temp = mkstemp(fname_temp)) >= 0) | |||
{ | |||
Error("Failed to resample: ",command); | |||
return(0); | |||
close(fd_temp); | |||
sprintf(command,"sox \"%s%s.wav\" -r %d -c 1 -w %s polyphase\n",path_source,fname,samplerate,fname_temp); | |||
if(system(command) < 0) | |||
{ | |||
Error("Failed to resample: ",command); | |||
return(0); | |||
} | |||
} | |||
f = fopen(fname_temp,"rb"); |
@@ -1516,8 +1516,8 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha | |||
} | |||
value = N_HASH_DICT; | |||
fwrite(&value,4,1,f_out); | |||
fwrite(&offset_rules,4,1,f_out); | |||
Write4Bytes(f_out,value); | |||
Write4Bytes(f_out,offset_rules); | |||
compile_dictlist_start(); | |||
@@ -87,20 +87,24 @@ void strncpy0(char *to,const char *from, int size) | |||
to[size-1] = 0; | |||
} | |||
// use the following macros for translation from little endian to host's endianness | |||
#ifdef ARCH_BIG | |||
int reverse_word_bytes(int word) | |||
{//============================= | |||
// reverse the order of bytes from little-endian to big-endian | |||
int ix; | |||
int word2 = 0; | |||
#define FIX_ENDIAN_USHORT(val) ((unsigned short) ( \ | |||
(unsigned short) ((unsigned short) (val) >> 8) | \ | |||
(unsigned short) ((unsigned short) (val) << 8))) | |||
for(ix=24; ix>=0; ix -= 8) | |||
{ | |||
word2 |= (word >> ix) & 0xff; | |||
word2 = word2 << 8; | |||
} | |||
return(word2); | |||
} | |||
#define FIX_ENDIAN_UINT(val) ((unsigned int) ( \ | |||
(((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \ | |||
(((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \ | |||
(((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \ | |||
(((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24))) | |||
#else | |||
# define FIX_ENDIAN_USHORT(val) (val) | |||
# define FIX_ENDIAN_UINT(val) (val) | |||
#endif | |||
@@ -157,7 +161,7 @@ int Translator::LoadDictionary(const char *name, int no_error) | |||
size = GetFileLength(fname); | |||
f = fopen(fname,"rb"); | |||
if((f == NULL) || (size == 0)) | |||
if((f == NULL) || (size <= 0)) | |||
{ | |||
if(no_error == 0) | |||
{ | |||
@@ -175,13 +179,15 @@ int Translator::LoadDictionary(const char *name, int no_error) | |||
pw = (int *)data_dictlist; | |||
length = pw[1]; | |||
length = FIX_ENDIAN_UINT(pw[1]); | |||
if(size <= (N_HASH_DICT + sizeof(int)*2)) | |||
{ | |||
fprintf(stderr,"Empty _dict file: '%s\n",fname); | |||
return(2); | |||
} | |||
if((pw[0] != N_HASH_DICT) || (length <= 0) || (length > 0x8000000)) | |||
if((FIX_ENDIAN_UINT(pw[0]) != N_HASH_DICT) || | |||
(length <= 0) || (length > 0x8000000)) | |||
{ | |||
fprintf(stderr,"Bad data: '%s'\n",fname); | |||
return(2); | |||
@@ -258,7 +264,9 @@ void Translator::InitGroups(void) | |||
pw = (unsigned int *)langopts.replace_chars; | |||
while(*pw != 0) | |||
{ | |||
*pw = reverse_word_bytes(*pw); | |||
*pw = FIX_ENDIAN_UINT(*pw); | |||
pw++; | |||
*pw = FIX_ENDIAN_UINT(*pw); | |||
pw++; | |||
} | |||
#endif |
@@ -126,7 +126,7 @@ static const short non_ascii_tab[] = { | |||
// characters U+00e0 to U+017f | |||
const short letter_accents_0e0[] = { | |||
const unsigned short letter_accents_0e0[] = { | |||
LETTER('a',M_GRAVE,0), // U+00e0 | |||
LETTER('a',M_ACUTE,0), | |||
LETTER('a',M_CIRCUMFLEX,0), | |||
@@ -291,7 +291,7 @@ LETTER('s',M_NAME,0), // long-s // U+17f | |||
// characters U+0250 to U+029F | |||
const short letter_accents_250[] = { | |||
const unsigned short letter_accents_250[] = { | |||
LETTER('a',M_TURNED,0), // U+250 | |||
LETTER(L_ALPHA,0,0), | |||
LETTER(L_ALPHA,M_TURNED,0), |
@@ -34,6 +34,10 @@ | |||
#include "voice.h" | |||
#include "translate.h" | |||
#ifdef PLATFORM_POSIX | |||
#include <unistd.h> | |||
#endif | |||
#include <locale.h> | |||
#define N_XML_BUF 256 | |||
@@ -642,6 +646,7 @@ static int LoadSoundFile(const char *fname, int index) | |||
if((f = fopen(fname,"rb")) != NULL) | |||
{ | |||
int ix; | |||
int fd_temp; | |||
const char *resample; | |||
int header[3]; | |||
@@ -660,11 +665,16 @@ static int LoadSoundFile(const char *fname, int index) | |||
else | |||
resample = "polyphase"; | |||
sprintf(fname_temp,"%s.wav",tmpnam(NULL)); | |||
sprintf(command,"sox \"%s\" -r %d -w -s -c1 %s %s\n", fname, samplerate, fname_temp, resample); | |||
if(system(command) == 0) | |||
strcpy(fname_temp,"/tmp/espeakXXXXXX"); | |||
if((fd_temp = mkstemp(fname_temp)) >= 0) | |||
{ | |||
fname = fname_temp; | |||
close(fd_temp); | |||
// sprintf(fname_temp,"%s.wav",tmpnam(NULL)); | |||
sprintf(command,"sox \"%s\" -r %d -w -s -c1 %s %s\n", fname, samplerate, fname_temp, resample); | |||
if(system(command) == 0) | |||
{ | |||
fname = fname_temp; | |||
} | |||
} | |||
} | |||
} |
@@ -35,7 +35,7 @@ | |||
#include "translate.h" | |||
#include "wave.h" | |||
const char *version_string = "1.32 04.Mar.08"; | |||
const char *version_string = "1.33 06.Mar.08"; | |||
const int version_phdata = 0x013200; | |||
int option_device_number = -1; |
@@ -82,7 +82,7 @@ const char *WordToString(unsigned int word) | |||
int ix; | |||
static char buf[5]; | |||
for(ix=0; ix<3; ix++) | |||
for(ix=0; ix<4; ix++) | |||
buf[ix] = word >> (ix*8); | |||
buf[4] = 0; | |||
return(buf); |
@@ -656,7 +656,7 @@ SetLengthMods(tr,3); // all equal | |||
case L('t','a'): // Tamil | |||
{ | |||
static const short stress_lengths_ta[8] = {190, 190, 200, 200, 0, 0, 220, 220}; | |||
static const short stress_lengths_ta[8] = {200, 200, 210, 210, 0, 0, 230, 230}; | |||
static const unsigned char stress_amps_ta[8] = {18,18, 18,18, 20,20, 22,22 }; | |||
tr = new Translator(); |
@@ -893,26 +893,39 @@ if((wmark > 0) && (wmark < 8)) | |||
} | |||
wordx[-1] = c_temp; | |||
pfix = 1; | |||
prefix_chars[0] = 0; | |||
n_chars = prefix_type & 0x3f; | |||
for(ix=0; ix < n_chars; ix++) // num. of bytes to remove | |||
if((prefix_type & SUFX_B) == 0) | |||
{ | |||
prefix_chars[pfix++] = *wordx++; | |||
for(ix=(prefix_type & 0xf); ix>0; ix--) // num. of characters to remove | |||
{ | |||
wordx++; | |||
while((*wordx & 0xc0) == 0x80) wordx++; // for multibyte characters | |||
} | |||
} | |||
else | |||
{ | |||
pfix = 1; | |||
prefix_chars[0] = 0; | |||
n_chars = prefix_type & 0x3f; | |||
if((prefix_type & SUFX_B) && (ix == (n_chars-1))) | |||
for(ix=0; ix < n_chars; ix++) // num. of bytes to remove | |||
{ | |||
prefix_chars[pfix-1] = 0; // discard the last character of the prefix, this is the separator character | |||
prefix_chars[pfix++] = *wordx++; | |||
if((prefix_type & SUFX_B) && (ix == (n_chars-1))) | |||
{ | |||
prefix_chars[pfix-1] = 0; // discard the last character of the prefix, this is the separator character | |||
} | |||
} | |||
prefix_chars[pfix] = 0; | |||
} | |||
prefix_chars[pfix] = 0; | |||
c_temp = wordx[-1]; | |||
wordx[-1] = ' '; | |||
confirm_prefix = 1; | |||
if(prefix_type & SUFX_B) | |||
{ | |||
// SUFX_B is used for Turkish, tr_rules contains "(Pb£ | |||
// retranslate the prefix part | |||
char *wordpf; | |||
char prefix_phonemes2[12]; |
@@ -31,6 +31,11 @@ | |||
#include "translate.h" | |||
#include "prosodydisplay.h" | |||
#ifdef PLATFORM_POSIX | |||
#include <unistd.h> | |||
#endif | |||
#include "wx/font.h" | |||
#include "wx/textctrl.h" | |||
#include "wx/button.h" | |||
@@ -372,6 +377,7 @@ void TranslDlg::OnCommand(wxCommandEvent& event) | |||
int clause_tone; | |||
int clause_count; | |||
FILE *f; | |||
int fd_temp; | |||
char fname_temp[100]; | |||
static int n_ph_list; | |||
static PHONEME_LIST ph_list[N_PH_LIST+1]; | |||
@@ -383,11 +389,25 @@ void TranslDlg::OnCommand(wxCommandEvent& event) | |||
case T_RULES: | |||
case MENU_SPEAK_RULES: | |||
option_phonemes = 2; | |||
#ifdef PLATFORM_POSIX | |||
strcpy(fname_temp,"/tmp/espeakXXXXXX"); | |||
if((fd_temp = mkstemp(fname_temp)) >= 0) | |||
{ | |||
close(fd_temp); | |||
if((f = fopen(fname_temp,"w+")) != NULL) | |||
{ | |||
f_trans = f; // write translation rule trace to a temp file | |||
} | |||
} | |||
#else | |||
strcpy(fname_temp,tmpnam(NULL)); | |||
if((f = fopen(fname_temp,"w+")) != NULL) | |||
{ | |||
f_trans = f; // write translation rule trace to a temp file | |||
} | |||
#endif | |||
case T_TRANSLATE: | |||
case MENU_SPEAK_TRANSLATE: | |||
option_multibyte = espeakCHARS_AUTO; |
@@ -1052,6 +1052,14 @@ static int ScoreVoice(espeak_VOICE *voice_spec, const char *spec_language, int s | |||
p = voice->languages; // list of languages+dialects for which this voice is suitable | |||
if(strcmp(spec_language,"mbrola")==0) | |||
{ | |||
// only list mbrola voices | |||
if(memcmp(voice->identifier,"mb/",3) == 0) | |||
return(100); | |||
return(0); | |||
} | |||
if(spec_n_parts == 0) | |||
{ | |||
score = 100; | |||
@@ -1198,6 +1206,7 @@ static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int | |||
for(ix=0; ix<n_voices_list; ix++) | |||
{ | |||
vp = voices_list[ix]; | |||
if(((control & 1) == 0) && (memcmp(vp->identifier,"mb/",3) == 0)) | |||
continue; | |||
@@ -816,8 +816,8 @@ static void WavegenSetEcho(void) | |||
if(embedded_value[EMBED_T] > 0) | |||
{ | |||
// announcing punctuation | |||
amp = embedded_value[EMBED_T] * 10; | |||
delay = 130; | |||
amp = embedded_value[EMBED_T] * 8; | |||
delay = 60; | |||
} | |||
if(delay == 0) | |||
@@ -825,6 +825,8 @@ static void WavegenSetEcho(void) | |||
echo_head = (delay * samplerate)/1000; | |||
echo_length = echo_head; // ensure completion of echo at the end of speech. Use 1 delay period? | |||
if(amp == 0) | |||
echo_length = 0; | |||
if(amp > 20) | |||
echo_length = echo_head * 2; // perhaps allow 2 echo periods if the echo is loud. | |||