lang=hu, set no secondary stress; [e:] [E] are closer, Don't consider mbrola voices during voice selection. Fix voice variant not being set from SSML. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@23 d46cf337-b52f-0410-862d-fd96e6ae7743master
| _17 d'is:'Et | _17 d'is:'Et | ||||
| _18 d'is:'w^it | _18 d'is:'w^it | ||||
| _19 d'is:n'@f | _19 d'is:n'@f | ||||
| _20 v'E~ | _20 v'E~ | ||||
| _21 v'E~te:E~ | _21 v'E~te:E~ | ||||
| _22 v'E~td'Y | _22 v'E~td'Y | ||||
| _23 v'E~t:tRw'a | _23 v'E~t:tRw'a | ||||
| // conjonctions | // conjonctions | ||||
| et e $u $pause | et e $u $brk | ||||
| ou $u $pause | ou $u $brk | ||||
| car $u $pause | car $u $brk | ||||
| soit $u $pause | soit $u $brk | ||||
| mais $u $pause | mais $u $brk | ||||
| ou u $u $pause | ou u $u $brk | ||||
| donc $u $pause | donc $u $brk | ||||
| or $u $pause | or $u $brk | ||||
| ni $u $pause | ni $u $brk | ||||
| car $u $pause | car $u $brk | ||||
| cependant $u $pause | cependant $u $brk | ||||
| néanmoins $u $pause | néanmoins $u $brk | ||||
| toutefois $u $pause | toutefois $u $brk | ||||
| comme $u $brk | |||||
| lorsque $u $brk | |||||
| comme $u $pause | puisque $u $brk | ||||
| lorsque $u $pause | quand $u $brk | ||||
| puisque $u $pause | que $u $brk | ||||
| quand $u $pause | qui $u $brk | ||||
| que $u $pause | quoique $u $brk | ||||
| qui $u $pause | si $u $brk | ||||
| quoique $u $pause | // (à cause que) $u $brk | ||||
| si $u $pause | // (ainsi que) $u $brk | ||||
| // (à mesure que) $u $brk | |||||
| // (à cause que) $u $pause | // (après que) $u $brk | ||||
| // (ainsi que) $u $pause | // (à moins que) $u $brk | ||||
| // (à mesure que) $u $pause | // (au lieu que) $u $brk | ||||
| // (après que) $u $pause | // (aussitôt que) $u $brk | ||||
| // (à moins que) $u $pause | // (pendant que) $u $brk | ||||
| // (au lieu que) $u $pause | |||||
| // (aussitôt que) $u $pause | |||||
| // (pendant que) $u $pause | |||||
| // (pourvu que) $u $pause | // (pourvu que) $u $pause | ||||
| // pronouns | // pronouns | ||||
| leurs $u+ | leurs $u+ | ||||
| // prepositions | // prepositions | ||||
| de $u $nounf | de $u $nounf | ||||
| du $u+ $nounf | du $u+ $nounf | ||||
| des dEz2 $u $nounf | des dEz2 $u $nounf | ||||
| ?2 des dez2 $u+ $nounf | ?2 des dez2 $u+ $nounf | ||||
| au $u $brk | au $u $brk | ||||
| aux $u $brk | aux $u $brk | ||||
| dans $u+ $pause | dans $u+ $brk | ||||
| sur $u+ $pause | sur $u+ $brk | ||||
| par $u+ $pause | par $u+ $brk | ||||
| pour $u+ $pause | pour $u+ $brk | ||||
| en $u+ $brk | en $u+ $brk | ||||
| (en effet) A~nEf'E $pause | (en effet) A~nEf'E $brk | ||||
| vers $u+ $pause | vers $u+ $brk | ||||
| avec $u+ $pause | avec $u+ $brk | ||||
| sans $u+ $pause | sans $u+ $brk | ||||
| sous $u+ $pause | sous $u+ $brk | ||||
| entre $u+ $pause | entre $u+ $brk | ||||
| contre $u+ $pause | contre $u+ $brk | ||||
| durant $pause | durant $brk | ||||
| // negative | // negative | ||||
| ne $u | ne $u | ||||
| fils fis | fils fis | ||||
| mars maRs | mars maRs | ||||
| pays pEi | pays pEi | ||||
| pourcent purs'A~ | |||||
| sens sA~s | sens sA~s | ||||
| c'est sEt2 $u | c'est sEt2 $u | ||||
| qu'à ka | qu'à ka |
| .group r | .group r | ||||
| r R | r R | ||||
| A) r (A R | A) r (A R | ||||
| K) r (A R | K) r (A @-* | ||||
| rr R | rr R | ||||
| r (_ R | r (_ R | ||||
| // Conjunctions | // Conjunctions | ||||
| és $u $pause // and | és $u $pause $strend2 // and | ||||
| de $u $pause // but | de $u+ $pause // but | ||||
| vagy $u $pause // or | vagy $u+ $pause // or | ||||
| mert $pause // because | mert $pause // because | ||||
| miatt $pause // because | miatt $pause // because | ||||
| ha $u $pause // if | ha $u $pause // if | ||||
| // Prepositions etc. | |||||
| // Negative | // Negative | ||||
| nem $u+ | nem $u+ | ||||
| ne $u+ | ne $u+ | ||||
| // Unstressed adverbs etc. | // Unstressed adverbs etc. | ||||
| néhány $u+ | néhány $u+ | ||||
| is $u // ?? | |||||
| // Verbs | // Verbs |
| .group r | .group r | ||||
| r R | r R | ||||
| A) r (A R | A) r (A * | ||||
| C) r (A R | C) r (A R | ||||
| r (C r | r (C r | ||||
| rr R | rr R |
| a A: | a A: | ||||
| a (C% A | a (C% A | ||||
| a (_ A | a (_ A | ||||
| X) a (CCX A // single syllable with >= 2 final consonants | X) a (CCK A // single syllable with >= 2 final consonants | ||||
| // or initial syllable with 3 consonants | |||||
| ai AI | ai AI | ||||
| au aU | au aU | ||||
| aa o: // å | aa o: // å | ||||
| aa (C% O | aa (C% O | ||||
| X) aa (CCX O | X) aa (CCK O | ||||
| ae a: // æ | ae a: // æ | ||||
| ae (C% a | ae (C% a | ||||
| X) ae (CCX a | X) ae (CCK a | ||||
| .group b | .group b | ||||
| .group e | .group e | ||||
| e e: | e e: | ||||
| e (C% E | e (C% E | ||||
| X) e (CCX E | X) e (CCK E | ||||
| ei aI | ei aI | ||||
| e (rC a // ?? | e (rC a // ?? | ||||
| &) e (_ @2 | &) e (_ @2 | ||||
| .group i | .group i | ||||
| i i: | i i: | ||||
| i (C% I | i (C% I | ||||
| X) i (CCX I | X) i (CCK I | ||||
| &) ig (_ I | &) ig (_ I | ||||
| .group j | .group j | ||||
| .group o | .group o | ||||
| o u: | o u: | ||||
| o (C% O | o (C% O | ||||
| X) o (CCX O | X) o (CCK O | ||||
| oi OI | oi OI | ||||
| oe Y: // ø | oe Y: // ø | ||||
| oe (C% W | oe (C% W | ||||
| X) oe (CCX W | X) oe (CCK W | ||||
| oey Yy | oey Yy | ||||
| o (nd U | o (nd U | ||||
| .group u | .group u | ||||
| u u-: | u u-: | ||||
| u (C% u- | u (C% u- | ||||
| X) u (CCX u- | X) u (CCK u- | ||||
| ui u-I | ui u-I | ||||
| .group v | .group v | ||||
| .group å | .group å | ||||
| å o: | å o: | ||||
| å (C% O | å (C% O | ||||
| X) å (CCX O | X) å (CCK O | ||||
| .group æ | .group æ | ||||
| æ E: | æ E: | ||||
| æ (r a: | æ (r a: | ||||
| æ (C% a | æ (C% a | ||||
| X) æ (CCX a | X) æ (CCK a | ||||
| .group ø | .group ø | ||||
| ø Y: | ø Y: | ||||
| ø (C% W | ø (C% W | ||||
| X) ø (CCX W | X) ø (CCK W | ||||
| øy Yy | øy Yy | ||||
| .group ä | .group ä | ||||
| ä E: | ä E: | ||||
| ä (C% E | ä (C% E | ||||
| X) ä (CCX E | X) ä (CCK E | ||||
| .group ö | .group ö | ||||
| ö Y: | ö Y: | ||||
| ö (C% W | ö (C% W | ||||
| X) ö (CCX W | X) ö (CCK W | ||||
| .group | .group | ||||
| é 'e: | é 'e: |
| 1 vowel/@_bck hi | 1 vowel/@_bck hi | ||||
| 13 vowel/e en en_n af cy eo fr hu hr it pt pt_pt vi | 13 vowel/e en en_n af cy eo fr hu hr it pt pt_pt vi | ||||
| 2 vowel/e# en_sc | 2 vowel/e# en_sc | ||||
| 7 vowel/e_2 en_sc de hi hu sv no | 6 vowel/e_2 en_sc de hi sv no | ||||
| 1 vowel/e_3 hu | |||||
| 1 vowel/e_5 en_sc | 1 vowel/e_5 en_sc | ||||
| 3 vowel/ee fr pl sv | 3 vowel/ee fr pl sv | ||||
| 2 vowel/e_e en_sc is | 2 vowel/e_e en_sc is | ||||
| 7 vowel/ee_1 en en_n pl it sv no zh_yue | 7 vowel/ee_1 en en_n pl it sv no zh_yue | ||||
| 4 vowel/ee_2 en cy hu nl | 3 vowel/ee_2 en cy nl | ||||
| 1 vowel/ee#_2 sv | 1 vowel/ee#_2 sv | ||||
| 3 vowel/ee_3 af pt vi | 3 vowel/ee_3 af pt vi | ||||
| 3 vowel/ee_6 en_n sk sv | 3 vowel/ee_6 en_n sk sv | ||||
| 11 vowel/e_mid en_rp en_wm fr_ca hi sk cs hr es pt_pt no is | 12 vowel/e_mid en_rp en_wm fr_ca hi hu sk cs hr es pt_pt no is | ||||
| 10 vowel/e_mid2 af de fi nl sk ro el sw | 10 vowel/e_mid2 af de fi nl sk ro el sw | ||||
| 1 vowel/@_fnt hr | 1 vowel/@_fnt hr | ||||
| 1 vowel/@_hgh no | 1 vowel/@_hgh no |
| phoneme E | phoneme E | ||||
| vowel starttype (e) endtype (e) | vowel starttype (e) endtype (e) | ||||
| length 130 | length 130 | ||||
| formants vowel/ee_2 | formants vowel/e_mid | ||||
| endphoneme | endphoneme | ||||
| phoneme e | phoneme e | ||||
| phoneme e: | phoneme e: | ||||
| vowel starttype (e) endtype (e) | vowel starttype (e) endtype (e) | ||||
| length 240 | length 240 | ||||
| formants vowel/e_2 | formants vowel/e_3 | ||||
| endphoneme | endphoneme | ||||
| phoneme A | phoneme A |
| // to something other than the default "C". Then, not only Latin1 but also the | // to something other than the default "C". Then, not only Latin1 but also the | ||||
| // other characters give the correct results with iswalpha() etc. | // other characters give the correct results with iswalpha() etc. | ||||
| if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | ||||
| setlocale(LC_CTYPE,""); | { | ||||
| if(setlocale(LC_CTYPE,"UTF-8") == NULL) | |||||
| setlocale(LC_CTYPE,""); | |||||
| } | |||||
| // Create the main frame window | // Create the main frame window |
| char* text[]= | |||||
| { | |||||
| "<voice xml:lang=\"en\" variant=\"1\">eSpeak.</voice>", | |||||
| " <voice xml:lang=\"en\" gender=\"male\" variant=\"1\"><prosody rate=\"1.0\"> normally would, </prosody></voice>" | |||||
| }; | |||||
| #ifdef deleted | #ifdef deleted | ||||
| void Test2() | void Test2() | ||||
| } | } | ||||
| #endif | #endif | ||||
| char* text1[]= | |||||
| { | |||||
| "<voice xml:lang=\"en\" variant=\"2\">eSpeak.</voice>", | |||||
| " <voice xml:lang=\"fr\" gender=\"male\" variant=\"3\"><prosody rate=\"1.0\"> normally would, </prosody></voice>" | |||||
| }; | |||||
| void TestTest(int control) | void TestTest(int control) | ||||
| {//======================= | {//======================= | ||||
| //CharsetToUnicode("ISCII"); | //CharsetToUnicode("ISCII"); | ||||
| return; | //return; | ||||
| if(control==2) | if(control==2) | ||||
| { | { | ||||
| espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS,100,NULL); | espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS,100,NULL); | ||||
| espeak_SetSynthCallback(TestSynthCallback); | espeak_SetSynthCallback(TestSynthCallback); | ||||
| // espeak_SetUriCallback(TestUriCallback); | |||||
| voice.languages = "fr"; | |||||
| voice.gender = 0; | |||||
| voice.age = 0; | |||||
| voice.variant = 0; | |||||
| ix = espeak_SetVoiceByName("pt-xx"); | |||||
| voice2 = espeak_GetCurrentVoice(); | unsigned int unique_identifier=0; | ||||
| int index=0; | |||||
| espeak_Synth(text1[index], strlen(text1[index])+1, 0, POS_CHARACTER, 0, espeakSSML|espeakCHARS_UTF8, &unique_identifier, NULL); | |||||
| // espeak_SetVoiceByProperties(&voice); | espeak_SetParameter(espeakPUNCTUATION, 1, 0); | ||||
| espeak_SetParameter(espeakRANGE,0,0); | espeak_Synchronize(); | ||||
| espeak_Synth(textbuf,ix+1,0,POS_CHARACTER,0,espeakCHARS_8BIT+espeakSSML,NULL,NULL); | // espeak_Cancel(); | ||||
| espeak_SetParameter(espeakPUNCTUATION, 1, 0); | |||||
| // for(voice.variant = 1; voice.variant < 9; voice.variant++) | index++; | ||||
| // { | espeak_Synth(text1[index], strlen(text1[index])+1, 0, POS_CHARACTER, 0, espeakSSML|espeakCHARS_UTF8, &unique_identifier, NULL); | ||||
| // espeak_SetVoiceByProperties(&voice); | |||||
| // espeak_Synth(textbuf,ix+1,0,POS_CHARACTER,0,espeakCHARS_8BIT+espeakSSML,NULL,NULL); | |||||
| // } | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| if(((c2 & 0xc0) != 0x80) && ((c2 & m) != 0)) | if((c2 & 0xc0) != 0x80) | ||||
| { | { | ||||
| GetC_unget(c2); | GetC_unget(c2); | ||||
| break; | break; | ||||
| return(0); // <s> or <p> without language spec, nothing to do | return(0); // <s> or <p> without language spec, nothing to do | ||||
| ssml_sp = &ssml_stack[n_ssml_stack++]; | ssml_sp = &ssml_stack[n_ssml_stack++]; | ||||
| attrcopy_utf8(ssml_sp->language,lang,sizeof(ssml_sp->language)); | attrcopy_utf8(ssml_sp->language,lang,sizeof(ssml_sp->language)); | ||||
| attrcopy_utf8(ssml_sp->voice_name,name,sizeof(ssml_sp->voice_name)); | attrcopy_utf8(ssml_sp->voice_name,name,sizeof(ssml_sp->voice_name)); | ||||
| ssml_sp->voice_variant = attrnumber(variant,1,0)-1; | ssml_sp->voice_variant = attrnumber(variant,1,0)-1; |
| setlocale(LC_CTYPE,"ISO8859-1"); | setlocale(LC_CTYPE,"ISO8859-1"); | ||||
| #else | #else | ||||
| if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | ||||
| setlocale(LC_CTYPE,""); | { | ||||
| if(setlocale(LC_CTYPE,"UTF-8") == NULL) | |||||
| setlocale(LC_CTYPE,""); | |||||
| } | |||||
| #endif | #endif | ||||
| // to something other than the default "C". Then, not only Latin1 but also the | // to something other than the default "C". Then, not only Latin1 but also the | ||||
| // other characters give the correct results with iswalpha() etc. | // other characters give the correct results with iswalpha() etc. | ||||
| #ifdef PLATFORM_RISCOS | #ifdef PLATFORM_RISCOS | ||||
| setlocale(LC_CTYPE,"ISO8859-1"); | setlocale(LC_CTYPE,"ISO8859-1"); | ||||
| #else | #else | ||||
| if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL) | ||||
| setlocale(LC_CTYPE,""); | { | ||||
| if(setlocale(LC_CTYPE,"UTF-8") == NULL) | |||||
| setlocale(LC_CTYPE,""); | |||||
| } | |||||
| #endif | #endif | ||||
| init_path(path); | init_path(path); |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.h" | #include "wave.h" | ||||
| const char *version_string = "1.25.06 23.May.07"; | const char *version_string = "1.25.08 25.May.07"; | ||||
| const int version_phdata = 0x012501; | const int version_phdata = 0x012501; | ||||
| int option_device_number = -1; | int option_device_number = -1; |
| tr->langopts.vowel_pause = 0x10; | tr->langopts.vowel_pause = 0x10; | ||||
| tr->langopts.stress_rule = 0; | tr->langopts.stress_rule = 0; | ||||
| tr->langopts.stress_flags = 0x16; | tr->langopts.stress_flags = 0x36; | ||||
| tr->langopts.unstressed_wd1 = 2; | |||||
| tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; // don't propagate over word boundaries | tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; // don't propagate over word boundaries | ||||
| tr->langopts.param[LOPT_IT_DOUBLING] = 1; | tr->langopts.param[LOPT_IT_DOUBLING] = 1; | ||||
| tr->langopts.long_stop = 130; | tr->langopts.long_stop = 130; |
| if((v != NULL) && (variant > 0)) | if((v != NULL) && (variant > 0)) | ||||
| { | { | ||||
| sprintf(buf,"!variant%d",variant); | sprintf(buf,"!variant%d",variant); | ||||
| LoadVoice(buf,2); | v = LoadVoice(buf,2); | ||||
| } | } | ||||
| return(v); | return(v); | ||||
| } | } | ||||
| } // end of ScoreVoice | } // end of ScoreVoice | ||||
| static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices) | static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int control) | ||||
| {//========================================================================= | {//====================================================================================== | ||||
| // control: bit0=1 include mbrola voices | |||||
| int ix; | int ix; | ||||
| int score; | int score; | ||||
| int nv; // number of candidates | int nv; // number of candidates | ||||
| nv = 0; | nv = 0; | ||||
| for(ix=0; ix<n_voices_list; ix++) | for(ix=0; ix<n_voices_list; ix++) | ||||
| { | { | ||||
| vp = voices_list[ix]; | |||||
| 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, n_parts, lang_len, voices_list[ix])) > 0) | ||||
| { | { | ||||
| voices[nv++] = vp = voices_list[ix]; | voices[nv++] = vp; | ||||
| vp->score = score; | vp->score = score; | ||||
| } | } | ||||
| } | } | ||||
| espeak_ListVoices(NULL); // create the voices list | espeak_ListVoices(NULL); // create the voices list | ||||
| // select and sort voices for the required language | // select and sort voices for the required language | ||||
| nv = SetVoiceScores(voice_select,voices); | nv = SetVoiceScores(voice_select,voices,0); | ||||
| if(nv == 0) | if(nv == 0) | ||||
| { | { | ||||
| if(voice_spec) | if(voice_spec) | ||||
| { | { | ||||
| // select the voices which match the voice_spec, and sort them by preference | // select the voices which match the voice_spec, and sort them by preference | ||||
| SetVoiceScores(voice_spec,voices); | SetVoiceScores(voice_spec,voices,1); | ||||
| return((const espeak_VOICE **)voices); | return((const espeak_VOICE **)voices); | ||||
| } | } | ||||