diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index 138e4184..7f4ab2c6 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -115,11 +115,11 @@ Dictionary fr_dict i i: o O O~ u W w^i W~ y Y -* : ; b c d D dZ -f g h j k l L m -n N n2 n^ p p2 r R -s S t t2 tS v w z -Z z2 z3 +* : ; b c d dZ f +g h j k l L m n +N n2 n^ p p2 r R s +S t t2 tS v w z Z +z2 z3 Dictionary hi_dict @@ -405,8 +405,8 @@ Z Dictionary ku_dict -a e E eI i I o u -U y +a e E eI eU i I o +u U y : b d dZ f g h j k l m n p q r R diff --git a/espeak-data/voices/en/en-r b/espeak-data/voices/en/en-r index 274edfb7..2f40651b 100755 --- a/espeak-data/voices/en/en-r +++ b/espeak-data/voices/en/en-r @@ -1,6 +1,7 @@ // moving towards US English name en-rhotic language en-r +language en-us language en 3 gender male diff --git a/src/compiledata.cpp b/src/compiledata.cpp index f4038ba8..f58ccd0b 100755 --- a/src/compiledata.cpp +++ b/src/compiledata.cpp @@ -2251,6 +2251,8 @@ void CompileMbrola() FILE *f_out; int percent; int n; + int *pw; + int *pw_end; int count = 0; int control; char phoneme[40]; @@ -2318,8 +2320,13 @@ void CompileMbrola() } data[count].name = 0; // list terminator - fwrite(&mbrola_ctrl,4,1,f_out); - fwrite(data,sizeof(MBROLA_TAB),count+1,f_out); + Write4Bytes(f_out, mbrola_ctrl); + + pw_end = (int *)(&data[count+1]); + for(pw = (int *)data; pw < pw_end; pw++) + { + Write4Bytes(f_out, *pw); + } fclose(f_out); wxLogStatus(_T("Mbrola translation file: %d phonemes"),count); } // end of CompileMbrola diff --git a/src/readclause.cpp b/src/readclause.cpp index 5bcf9573..b4b6ce67 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -804,6 +804,7 @@ static const char *VoiceFromStack() int ix; SSML_STACK *sp; const char *v_id; + int voice_name_specified; espeak_VOICE voice_select; char voice_name[40]; char language[40]; @@ -818,9 +819,11 @@ static const char *VoiceFromStack() for(ix=0; ixvoice_name[0] != 0) && (SelectVoiceByName(NULL,sp->voice_name) != NULL)) { + voice_name_specified = 1; strcpy(voice_name, sp->voice_name); language[0] = 0; voice_select.gender = 0; @@ -828,7 +831,11 @@ static const char *VoiceFromStack() voice_select.variant = 0; } if(sp->language[0] != 0) + { strcpy(language, sp->language); + if(voice_name_specified == 0) + voice_name[0] = 0; // forget a previous voice name if a language is specified + } if(sp->voice_gender != 0) voice_select.gender = sp->voice_gender; if(sp->voice_age != 0) diff --git a/src/synth_mbrola.cpp b/src/synth_mbrola.cpp index 143bc65d..ec66e8ec 100755 --- a/src/synth_mbrola.cpp +++ b/src/synth_mbrola.cpp @@ -33,6 +33,7 @@ #include "translate.h" #include "voice.h" +extern int Read4Bytes(FILE *f); #ifdef USE_MBROLA_LIB @@ -115,6 +116,8 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int // Load a phoneme name translation table from espeak-data/mbrola int size; + int ix; + int *pw; FILE *f_in; char path[sizeof(path_home)+15]; @@ -160,10 +163,17 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int fclose(f_in); return(EE_INTERNAL_ERROR); } - fread(&mbrola_control,4,1,f_in); + + mbrola_control = Read4Bytes(f_in); + pw = (int *)mbrola_tab; + for(ix=4; ix> 16) == (unsigned int)tolower(next_in)) + if((word >> 16) == (unsigned int)towlower(next_in)) { new_c = replace_chars[ix+1]; ignore_next = 1; @@ -2393,6 +2393,10 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou } n_ph_list2 += 2; + if(count_words == 0) + { + clause_pause = 0; + } if(Eof() && ((word_count == 0) || (option_endpause==0))) { clause_pause = 10; diff --git a/src/voices.cpp b/src/voices.cpp index ba847854..b446e6a7 100755 --- a/src/voices.cpp +++ b/src/voices.cpp @@ -1035,8 +1035,8 @@ static int __cdecl VoiceScoreSorter(const void *p1, const void *p2) } -static int ScoreVoice(espeak_VOICE *voice_spec, int spec_n_parts, int spec_lang_len, espeak_VOICE *voice) -{//====================================================================================================== +static int ScoreVoice(espeak_VOICE *voice_spec, const char *spec_language, int spec_n_parts, int spec_lang_len, espeak_VOICE *voice) +{//========================================================================================================================= int ix; const char *p; int c1, c2; @@ -1058,7 +1058,7 @@ static int ScoreVoice(espeak_VOICE *voice_spec, int spec_n_parts, int spec_lang_ } else { - if((*p == 0) && (strcmp(voice_spec->languages,"variants")==0)) + if((*p == 0) && (strcmp(spec_language,"variants")==0)) { // match on a voice with no languages if the required language is "variants" score = 100; @@ -1075,7 +1075,7 @@ static int ScoreVoice(espeak_VOICE *voice_spec, int spec_n_parts, int spec_lang_ for(ix=0; ; ix++) { - if((ix >= spec_lang_len) || ((c1 = voice_spec->languages[ix]) == '-')) + if((ix >= spec_lang_len) || ((c1 = spec_language[ix]) == '-')) c1 = 0; if((c2 = p[ix]) == '-') c2 = 0; @@ -1179,17 +1179,17 @@ static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int int nv; // number of candidates int n_parts=0; int lang_len=0; - const char *p; espeak_VOICE *vp; + char language[80]; // count number of parts in the specified language if((voice_select->languages != NULL) && (voice_select->languages[0] != 0)) { n_parts = 1; lang_len = strlen(voice_select->languages); - for(p = voice_select->languages; *p != 0; p++) + for(ix=0; (ix<=lang_len) && ((unsigned)ix < sizeof(language)); ix++) { - if(*p == '-') + if((language[ix] = tolower(voice_select->languages[ix])) == '-') n_parts++; } } @@ -1201,7 +1201,7 @@ static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int if(((control & 1) == 0) && (memcmp(vp->identifier,"mb/",3) == 0)) continue; - if((score = ScoreVoice(voice_select, n_parts, lang_len, voices_list[ix])) > 0) + if((score = ScoreVoice(voice_select, language, n_parts, lang_len, voices_list[ix])) > 0) { voices[nv++] = vp; vp->score = score;