From eab1faff96813a74ad80017d5595614f385b484d Mon Sep 17 00:00:00 2001 From: jonsd Date: Thu, 6 Mar 2008 14:47:20 +0000 Subject: [PATCH] [1.33] continued git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@159 d46cf337-b52f-0410-862d-fd96e6ae7743 --- dictsource/ku_list | 127 ++++++++++++++++++++++++++ dictsource/ku_rules | 115 +++++++++++++++++++++++ phsource/compile_report | 39 +++----- phsource/ph_english_us | 6 +- phsource/ph_icelandic | 13 +++ phsource/ph_tamil | 6 +- phsource/phonemes | 6 -- phsource/vwl_en_us/ii_2 | Bin 7276 -> 7276 bytes platforms/windows/make_espeak.iss | 2 +- platforms/windows/make_espeakedit.iss | 2 +- src/Makefile | 8 +- src/compiledata.cpp | 20 +++- src/compiledict.cpp | 4 +- src/dictionary.cpp | 42 +++++---- src/numbers.cpp | 4 +- src/readclause.cpp | 18 +++- src/synthdata.cpp | 2 +- src/synthesize.cpp | 2 +- src/tr_languages.cpp | 2 +- src/translate.cpp | 31 +++++-- src/transldlg.cpp | 20 ++++ src/voices.cpp | 9 ++ src/wavegen.cpp | 6 +- 23 files changed, 395 insertions(+), 89 deletions(-) create mode 100644 dictsource/ku_list create mode 100644 dictsource/ku_rules diff --git a/dictsource/ku_list b/dictsource/ku_list new file mode 100644 index 00000000..9b88238d --- /dev/null +++ b/dictsource/ku_list @@ -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 diff --git a/dictsource/ku_rules b/dictsource/ku_rules new file mode 100644 index 00000000..b256c179 --- /dev/null +++ b/dictsource/ku_rules @@ -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 diff --git a/phsource/compile_report b/phsource/compile_report index fd4c853f..1b9ed98d 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -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 diff --git a/phsource/ph_english_us b/phsource/ph_english_us index c9bdd59a..e3d705f6 100644 --- a/phsource/ph_english_us +++ b/phsource/ph_english_us @@ -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 diff --git a/phsource/ph_icelandic b/phsource/ph_icelandic index 6bd6c79a..9e7c8d49 100644 --- a/phsource/ph_icelandic +++ b/phsource/ph_icelandic @@ -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 + diff --git a/phsource/ph_tamil b/phsource/ph_tamil index ba594670..910f82ac 100644 --- a/phsource/ph_tamil +++ b/phsource/ph_tamil @@ -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 diff --git a/phsource/phonemes b/phsource/phonemes index 6cabc10f..d2587ff2 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -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 - diff --git a/phsource/vwl_en_us/ii_2 b/phsource/vwl_en_us/ii_2 index 6c850ea5848171a495ac3fd0712596b68807478b..4db46efdfff114865df29b13a516008c0527f351 100644 GIT binary patch delta 324 zcmaE3@y2391WO_(`&_0cOu>w+8DbbaM3ynGV`SwlVld`-BBaZd$0Wl2i{T2_TtQ)` z2aNfA?2PriC-@&QK48oelwhlS=?@-BsR1xOE~z8;G!ufdORQMV{IG013lZtpET3 delta 324 zcmaE3@y2391WRHA+d`%%Ou>w+86p@NM3ynGV`SwlV({RQ6*ghYV-n&1#qfZuRgjnI z0b@QNJ7XJfHU9&~2aH*Qa?Cyaja(o$14AN*qI4t+ge@RYAr}W!4HD;I(onYDypv@$ zGt`;@#x-zj{&Qr(t@*+w!3eWPolhHX%_2c97KAkn3 +#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"); diff --git a/src/compiledict.cpp b/src/compiledict.cpp index 50c28ab0..3c48d360 100755 --- a/src/compiledict.cpp +++ b/src/compiledict.cpp @@ -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(); diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 9eb899bb..195bb31b 100755 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -87,20 +87,24 @@ void strncpy0(char *to,const char *from, int size) to[size-1] = 0; } -#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; - for(ix=24; ix>=0; ix -= 8) - { - word2 |= (word >> ix) & 0xff; - word2 = word2 << 8; - } - return(word2); -} +// use the following macros for translation from little endian to host's endianness + +#ifdef ARCH_BIG +#define FIX_ENDIAN_USHORT(val) ((unsigned short) ( \ + (unsigned short) ((unsigned short) (val) >> 8) | \ + (unsigned short) ((unsigned short) (val) << 8))) + +#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 diff --git a/src/numbers.cpp b/src/numbers.cpp index d1f81a8b..e53533bc 100644 --- a/src/numbers.cpp +++ b/src/numbers.cpp @@ -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), diff --git a/src/readclause.cpp b/src/readclause.cpp index 1da0558a..b3a12bdc 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -34,6 +34,10 @@ #include "voice.h" #include "translate.h" +#ifdef PLATFORM_POSIX +#include +#endif + #include #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; + } } } } diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 70bb0b63..c1582467 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -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; diff --git a/src/synthesize.cpp b/src/synthesize.cpp index f0b83457..bf00603a 100755 --- a/src/synthesize.cpp +++ b/src/synthesize.cpp @@ -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); diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 9b8c4a89..12595c17 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -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(); diff --git a/src/translate.cpp b/src/translate.cpp index 44db22aa..9c367d56 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -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++; - - if((prefix_type & SUFX_B) && (ix == (n_chars-1))) + for(ix=(prefix_type & 0xf); ix>0; ix--) // num. of characters to remove { - prefix_chars[pfix-1] = 0; // discard the last character of the prefix, this is the separator character + wordx++; + while((*wordx & 0xc0) == 0x80) wordx++; // for multibyte characters } } - prefix_chars[pfix] = 0; + else + { + pfix = 1; + prefix_chars[0] = 0; + n_chars = prefix_type & 0x3f; + + for(ix=0; ix < n_chars; ix++) // num. of bytes to remove + { + 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; + } 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]; diff --git a/src/transldlg.cpp b/src/transldlg.cpp index b63c27a7..76162579 100755 --- a/src/transldlg.cpp +++ b/src/transldlg.cpp @@ -31,6 +31,11 @@ #include "translate.h" #include "prosodydisplay.h" +#ifdef PLATFORM_POSIX +#include +#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; diff --git a/src/voices.cpp b/src/voices.cpp index 734f841e..3f24bbb0 100755 --- a/src/voices.cpp +++ b/src/voices.cpp @@ -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; ixidentifier,"mb/",3) == 0)) continue; diff --git a/src/wavegen.cpp b/src/wavegen.cpp index 1a91b769..9d338635 100755 --- a/src/wavegen.cpp +++ b/src/wavegen.cpp @@ -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.