Added new phonemes [s.] and [z.] (as common phonemes), use in Lang=ru, Lang=sv, Lang=hi Remake WAV files for [s;] and [z;] phonemes. espeak_Terminate(), set pointers to NULL after free(). espeak_Initialize(), returns EE_INTERNAL_ERROR (-1) if fails to allocate memory. Change to the default tone setting (array: tone_points in voices.cpp). git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@5 d46cf337-b52f-0410-862d-fd96e6ae7743master
| ऱ r@ | ऱ r@ | ||||
| व v@ | व v@ | ||||
| श S@ | श S@ | ||||
| ष S@ // should be retroflex [S] | |||||
| ष s.@ // should be retroflex [S] | |||||
| स s@ | स s@ | ||||
| ह H@ | ह H@ | ||||
| क़ q@ | क़ q@ |
| ?1 श (_ S | ?1 श (_ S | ||||
| .group ष | .group ष | ||||
| ष SV //?? or retroflex [S] | |||||
| ष (B S //?? | |||||
| ?1 ष (_ S //?? | |||||
| ष s.V //?? or retroflex [S] | |||||
| ष (B s. //?? | |||||
| ?1 ष (_ s. //?? | |||||
| .group स | .group स | ||||
| स sV | स sV |
| _3 t;r'i | _3 t;r'i | ||||
| _4 ts;It'yr;I | _4 ts;It'yr;I | ||||
| _5 p;'jat; | _5 p;'jat; | ||||
| _6 S'Es;t; | |||||
| _6 s.'Es;t; | |||||
| _7 s;'em | _7 s;'em | ||||
| _8 v'os;E2m | _8 v'os;E2m | ||||
| _9 d;'ev;It; | _9 d;'ev;It; | ||||
| _13 tr;In'AttsVt; | _13 tr;In'AttsVt; | ||||
| _14 ts;It'y@-*nVttsVt; | _14 ts;It'y@-*nVttsVt; | ||||
| _15 p;Itn'AttsVt; | _15 p;Itn'AttsVt; | ||||
| _16 SE#stn'AttsVt; | |||||
| _16 s.E#stn'AttsVt; | |||||
| _17 s;Imn'AttsVt; | _17 s;Imn'AttsVt; | ||||
| _18 vOs;Imn'AttsVt; | _18 vOs;Imn'AttsVt; | ||||
| _19 d;E2v;Itn'AttsVt; | _19 d;E2v;Itn'AttsVt; | ||||
| _3X tr;'ittsVt; | _3X tr;'ittsVt; | ||||
| _4X s'o@-*Ok | _4X s'o@-*Ok | ||||
| _5X p;Id;d;Is;'jat | _5X p;Id;d;Is;'jat | ||||
| _6X SE2z;d;d;Is;'jat | |||||
| _6X s.E2z;d;d;Is;'jat | |||||
| _7X s;'emd;E2s;It | _7X s;'emd;E2s;It | ||||
| _8X v'os;E2md;E2s;It | _8X v'os;E2md;E2s;It | ||||
| _9X d;E2v;In'ostO | _9X d;E2v;In'ostO | ||||
| _3C tr;'ista | _3C tr;'ista | ||||
| _4C ts;It'yr;E2sta | _4C ts;It'yr;E2sta | ||||
| _5C p;,It;s'ot | _5C p;,It;s'ot | ||||
| _6C S,E#s;t;s'ot | |||||
| _6C s.,E#s;t;s'ot | |||||
| _7C s;,Ims'ot | _7C s;,Ims'ot | ||||
| _8C vOs;Ims'ot | _8C vOs;Ims'ot | ||||
| _9C d;E2v;It;s'ot | _9C d;E2v;It;s'ot | ||||
| // questions | // questions | ||||
| что Sto $u $pause // what, that | |||||
| что s.to $u $pause // what, that | |||||
| // misc. | // misc. |
| .group ж | .group ж | ||||
| _) ж (_ ZE | |||||
| ж (кY S | |||||
| ж (кь S | |||||
| ж (пY S | |||||
| ж (пь S | |||||
| ж (сь S | |||||
| ж (сY S | |||||
| ж (ть S | |||||
| ж (тY S | |||||
| ж (фь S | |||||
| ж (фY S | |||||
| ж (ффь S | |||||
| ж (ффY S | |||||
| ж (хь S | |||||
| ж (хY S | |||||
| ж (хкY S | |||||
| ж (хкь S | |||||
| ж Z | |||||
| _) ж (_ z.E | |||||
| ж (кY s. | |||||
| ж (кь s. | |||||
| ж (пY s. | |||||
| ж (пь s. | |||||
| ж (сь s. | |||||
| ж (сY s. | |||||
| ж (ть s. | |||||
| ж (тY s. | |||||
| ж (фь s. | |||||
| ж (фY s. | |||||
| ж (ффь s. | |||||
| ж (ффY s. | |||||
| ж (хь s. | |||||
| ж (хY s. | |||||
| ж (хкY s. | |||||
| ж (хкь s. | |||||
| ж z. | |||||
| .group з | .group з | ||||
| _) з (_ zE | _) з (_ zE | ||||
| з (сь s; | з (сь s; | ||||
| з (сY s; | з (сY s; | ||||
| з (ж Z | |||||
| з (ш S | |||||
| з (ж z. | |||||
| з (ш s. | |||||
| з (щ s;s; | з (щ s;s; | ||||
| з (ч s;s; | з (ч s;s; | ||||
| з z | з z | ||||
| .group о | .group о | ||||
| о o | о o | ||||
| о (B oj | |||||
| о (Cь oj | |||||
| о (FY oj | |||||
| .group п | .group п | ||||
| _) п (_ pE | _) п (_ pE | ||||
| с (дY z; | с (дY z; | ||||
| с (дB z; | с (дB z; | ||||
| с (ж Z | |||||
| с (ш S | |||||
| с (щ s;s; | |||||
| с (ч s;s; | |||||
| с (ж z. | |||||
| с (ш s. | |||||
| с (щ s; | |||||
| с (ч s; | |||||
| с s | с s | ||||
| т (ж d | т (ж d | ||||
| т t | |||||
| т t | |||||
| .group у | .group у | ||||
| _) у (_ u | _) у (_ u | ||||
| .group ш | .group ш | ||||
| _) ш (_ SA | |||||
| ш (б Z | |||||
| ш (бь Z | |||||
| ш (бY Z | |||||
| ш (бмь Z | |||||
| ш (бмY Z | |||||
| ш (бвь Z | |||||
| ш (бвY Z | |||||
| ш (г Z | |||||
| ш (гь Z | |||||
| ш (гY Z | |||||
| ш (д Z | |||||
| ш (дь Z | |||||
| ш (дY Z | |||||
| ш (дB Z | |||||
| ш (ж Z | |||||
| ш (з Z | |||||
| ш (зь Z | |||||
| ш (зY Z | |||||
| _) ш (_ s.A | |||||
| ш (б z. | |||||
| ш (бь z. | |||||
| ш (бY z. | |||||
| ш (бмь z. | |||||
| ш (бмY z. | |||||
| ш (бвь z. | |||||
| ш (бвY z. | |||||
| ш (г z. | |||||
| ш (гь z. | |||||
| ш (гY z. | |||||
| ш (д z. | |||||
| ш (дь z. | |||||
| ш (дY z. | |||||
| ш (дB z. | |||||
| ш (ж z. | |||||
| ш (з z. | |||||
| ш (зь z. | |||||
| ш (зY z. | |||||
| ш S | |||||
| ш s. | |||||
| .group щ | .group щ | ||||
| _) щ (_ S;ja | _) щ (_ S;ja |
| .group r | .group r | ||||
| r r | r r | ||||
| r) r | r) r | ||||
| rs S | |||||
| rs s. | |||||
| rsi (o rsx' | rsi (o rsx' | ||||
| rsk Sk | |||||
| rsk s.k | |||||
| rsk (i rsx | rsk (i rsx | ||||
| rss S | |||||
| rss s. | |||||
| rg (_ rj | rg (_ rj | ||||
| radera rad'e:ra | radera rad'e:ra | ||||
| .group a | .group a | ||||
| a a: | a a: | ||||
| ai a:I | ai a:I | ||||
| qu kw | qu kw | ||||
| .group r | .group r | ||||
| r D | |||||
| r z; | |||||
| .group s | .group s | ||||
| s s | s s |
| 33 phoneme tables | 33 phoneme tables | ||||
| new total | new total | ||||
| base 89 89 | |||||
| en 52 136 | |||||
| en_n 29 136 | |||||
| en_us 36 136 | |||||
| en_sc 39 138 | |||||
| en_rp 34 136 | |||||
| en_wm 30 136 | |||||
| af 37 120 | |||||
| cy 30 115 | |||||
| de 28 112 | |||||
| eo 15 101 | |||||
| fi 40 120 | |||||
| fr 32 113 | |||||
| fr_ca 11 113 | |||||
| hi 50 125 | |||||
| hu 24 106 | |||||
| nl 25 109 | |||||
| pl 17 100 | |||||
| sk 22 115 | |||||
| cs 6 116 | |||||
| hr 15 119 | |||||
| ru 35 116 | |||||
| it 28 109 | |||||
| es 7 109 | |||||
| pt 25 124 | |||||
| pt_pt 17 124 | |||||
| ro 36 133 | |||||
| el 7 109 | |||||
| sv 25 111 | |||||
| no 29 115 | |||||
| vi 41 126 | |||||
| zh_yue 32 117 | |||||
| sw 14 98 | |||||
| base 91 91 | |||||
| en 52 138 | |||||
| en_n 29 138 | |||||
| en_us 36 138 | |||||
| en_sc 39 140 | |||||
| en_rp 34 138 | |||||
| en_wm 30 138 | |||||
| af 37 122 | |||||
| cy 30 117 | |||||
| de 28 114 | |||||
| eo 15 103 | |||||
| fi 40 122 | |||||
| fr 32 115 | |||||
| fr_ca 11 115 | |||||
| hi 50 127 | |||||
| hu 24 108 | |||||
| nl 25 111 | |||||
| pl 17 102 | |||||
| sk 22 117 | |||||
| cs 6 118 | |||||
| hr 15 121 | |||||
| ru 36 119 | |||||
| it 28 111 | |||||
| es 7 111 | |||||
| pt 25 126 | |||||
| pt_pt 17 126 | |||||
| ro 36 135 | |||||
| el 7 111 | |||||
| sv 25 113 | |||||
| no 29 117 | |||||
| vi 41 128 | |||||
| zh_yue 32 119 | |||||
| sw 14 100 | |||||
| 3 b/b base hi ro | 3 b/b base hi ro | ||||
| 2 b/b_ base hi | 2 b/b_ base hi | ||||
| 1 ufric/sh_ base | 1 ufric/sh_ base | ||||
| 2 ufric/sh_pzd base ro | 2 ufric/sh_pzd base ro | ||||
| 3 ufric/sh_pzd_ base | 3 ufric/sh_pzd_ base | ||||
| 5 ufric/s_pzd base ro | |||||
| 2 ufric/sh_rfx base | |||||
| 3 ufric/s_pzd base ro | |||||
| 2 ufric/s_pzd_ base | |||||
| 1 ufric/sx_sv sv | 1 ufric/sx_sv sv | ||||
| 1 ufric/th base | 1 ufric/th base | ||||
| 1 ufric/th_ base | 1 ufric/th_ base | ||||
| 1 vdiph/y#y fi | 1 vdiph/y#y fi | ||||
| 2 vdiph/y#y_2 af zh_yue | 2 vdiph/y#y_2 af zh_yue | ||||
| 1 vdiph/y#y_3 nl | 1 vdiph/y#y_3 nl | ||||
| 2 vnasal/aa_n en fr | |||||
| 1 vnasal/aa_n3 af | |||||
| 1 vnasal/aa_n en | |||||
| 2 vnasal/aa_n3 af fr | |||||
| 2 vnasal/ee_n en fr_ca | 2 vnasal/ee_n en fr_ca | ||||
| 3 vnasal/ee_n2 hi pl pt_pt | 3 vnasal/ee_n2 hi pl pt_pt | ||||
| 2 vnasal/e_n af pt | 2 vnasal/e_n af pt | ||||
| 1 vnasal/oi_n pt | 1 vnasal/oi_n pt | ||||
| 2 vnasal/o_n hi pt | 2 vnasal/o_n hi pt | ||||
| 1 vnasal/o_n2 af | 1 vnasal/o_n2 af | ||||
| 2 vnasal/oo_n en fr | |||||
| 1 vnasal/o_n3 fr | |||||
| 1 vnasal/oo_n en | |||||
| 2 vnasal/oo_n2 hi pl | 2 vnasal/oo_n2 hi pl | ||||
| 1 vnasal/&u_n pt | 1 vnasal/&u_n pt | ||||
| 1 vnasal/u_n pt | 1 vnasal/u_n pt | ||||
| 1 vocw/Q2 nl | 1 vocw/Q2 nl | ||||
| 6 vocw/v base ro | 6 vocw/v base ro | ||||
| 4 vocw/zh base ro | 4 vocw/zh base ro | ||||
| 1 vocw/zh_rfx cs | |||||
| 3 vocw/zh_rfx base cs | |||||
| 3 voc/z base fr ro | 3 voc/z base fr ro | ||||
| 3 voc/z_ base fr ro | 3 voc/z_ base fr ro | ||||
| 2 voc/zh base ro | |||||
| 2 voc/zh_ base ro | |||||
| 3 voc/zh base ro | |||||
| 3 voc/zh_ base ro | |||||
| 1 voc/zh_2 cs | 1 voc/zh_2 cs | ||||
| 2 voc/z_pzd base | 2 voc/z_pzd base | ||||
| 2 voc/z_pzd_ base | 2 voc/z_pzd_ base | ||||
| 14 vowel/@ base en en_us en_rp cy hi hr | 14 vowel/@ base en en_us en_rp cy hi hr | ||||
| 1 vowel/@- base | 1 vowel/@- base | ||||
| 4 vowel/& en_rp fi hi sv | 4 vowel/& en_rp fi hi sv | ||||
| 5 vowel/0 en fr hi it pt | |||||
| 4 vowel/0 en hi it pt | |||||
| 4 vowel/0_2 en_n en_wm pt_pt sw | 4 vowel/0_2 en_n en_wm pt_pt sw | ||||
| 5 vowel/0_3 en_us en_sc en_rp hu | 5 vowel/0_3 en_us en_sc en_rp hu | ||||
| 1 vowel/@_2 fr | 1 vowel/@_2 fr | ||||
| 5 vowel/a_2 eo it pt_pt ro vi | 5 vowel/a_2 eo it pt_pt ro vi | ||||
| 3 vowel/a#_2 hr sv sw | 3 vowel/a#_2 hr sv sw | ||||
| 5 vowel/a_3 en_sc cs | 5 vowel/a_3 en_sc cs | ||||
| 11 vowel/a#_3 en en_n en_us en_wm de hi pt_pt vi zh_yue | |||||
| 12 vowel/a#_3 en en_n en_us en_wm de hi ru pt_pt vi zh_yue | |||||
| 4 vowel/a_4 en_wm el vi | 4 vowel/a_4 en_wm el vi | ||||
| 2 vowel/a_5 sv sw | 2 vowel/a_5 sv sw | ||||
| 7 vowel/aa en_us fi fr_ca no zh_yue | 7 vowel/aa en_us fi fr_ca no zh_yue | ||||
| 2 vowel/ii_4 en_rp | 2 vowel/ii_4 en_rp | ||||
| 6 vowel/ii_en en en_n | 6 vowel/ii_en en en_n | ||||
| 5 vowel/@_low hi ro no | 5 vowel/@_low hi ro no | ||||
| 9 vowel/o en en_wm de fr hi it pt_pt sv | |||||
| 8 vowel/o en en_wm de hi it pt_pt sv | |||||
| 4 vowel/o_2 cy hi hu no | 4 vowel/o_2 cy hi hu no | ||||
| 2 vowel/o-_2 en_n en_wm | 2 vowel/o-_2 en_n en_wm | ||||
| 2 vowel/o_3 en_sc | 2 vowel/o_3 en_sc | ||||
| 1 vowel/o-_3 en_rp | 1 vowel/o-_3 en_rp | ||||
| 1 vowel/o_4 en_n | |||||
| 1 vowel/o_6 nl | |||||
| 2 vowel/o_4 en_n fr | |||||
| 2 vowel/o_6 fr nl | |||||
| 4 vowel/oe en af de fr | 4 vowel/oe en af de fr | ||||
| 1 vowel/oe_2 no | 1 vowel/oe_2 no | ||||
| 1 vowel/oe_4 sv | 1 vowel/oe_4 sv |
| phoneme o | phoneme o | ||||
| vowel starttype (o) endtype (o) | vowel starttype (o) endtype (o) | ||||
| length 166 | length 166 | ||||
| formants vowel/o | |||||
| formants vowel/o_4 | |||||
| endphoneme | endphoneme | ||||
| phoneme O | phoneme O | ||||
| vowel starttype (o) endtype (o) | vowel starttype (o) endtype (o) | ||||
| length 190 | length 190 | ||||
| formants vowel/0 | |||||
| formants vowel/o_6 | |||||
| endphoneme | endphoneme | ||||
| phoneme A~ | phoneme A~ | ||||
| vowel starttype (a) endtype (a) | vowel starttype (a) endtype (a) | ||||
| length 222 | length 222 | ||||
| formants vnasal/aa_n | |||||
| formants vnasal/aa_n3 | |||||
| endphoneme | endphoneme | ||||
| phoneme O~ | phoneme O~ | ||||
| vowel starttype (o) endtype (o) | vowel starttype (o) endtype (o) | ||||
| length 222 | length 222 | ||||
| formants vnasal/oo_n | |||||
| formants vnasal/o_n3 | |||||
| endphoneme | endphoneme | ||||
| length 100 | length 100 | ||||
| lengthmod 7 | lengthmod 7 | ||||
| beforenotvowel r/ | beforenotvowel r/ | ||||
| trill | |||||
| formants vwl_fr/@R+r3/rx%80 | formants vwl_fr/@R+r3/rx%80 | ||||
| endphoneme | endphoneme | ||||
| phoneme z2 // silent unless followed by vowel | phoneme z2 // silent unless followed by vowel | ||||
| beforenotvowel NULL | beforenotvowel NULL | ||||
| vcd alv frc sibilant | vcd alv frc sibilant | ||||
| vowelout f1=0 f2=1700 -300 300 f3=-100 60 len=50 | |||||
| vowelout f1=0 f2=1700 -300 300 f3=-100 60 len=50 | |||||
| formants voc/z+ufric/s_ | formants voc/z+ufric/s_ | ||||
| before _ voc/z_+ufric/s_ | before _ voc/z_+ufric/s_ | ||||
| lengthmod 6 | lengthmod 6 | ||||
| length 100 | length 100 | ||||
| endphoneme | endphoneme | ||||
| phoneme a# | |||||
| vowel starttype (a) endtype (a) | |||||
| formants vowel/a#_3 | |||||
| length 100 | |||||
| endphoneme | |||||
| endphoneme | endphoneme | ||||
| phoneme z. | |||||
| vcd pla frc sibilant | |||||
| vowelin f1=0 f2=1800 -100 300 f3=-300 80 | |||||
| vowelout f1=2 f2=1800 -100 300 f3=-300 80 brk | |||||
| formants voc/zh+vocw/zh_rfx | |||||
| before _ voc/zh_+vocw/zh_rfx | |||||
| lengthmod 6 | |||||
| switchvoicing s. | |||||
| endphoneme | |||||
| phoneme z; | phoneme z; | ||||
| vcd pal frc sibilant palatal | vcd pal frc sibilant palatal | ||||
| vowelin f1=2 f2=2700 400 600 f3=300 80 rate len=70 | vowelin f1=2 f2=2700 400 600 f3=300 80 rate len=70 | ||||
| vowelout f1=2 f2=2300 250 300 f3=-300 80 brk | vowelout f1=2 f2=2300 250 300 f3=-300 80 brk | ||||
| formants voc/z_pzd+ufric/s_pzd%40 | |||||
| before _ voc/z_pzd_+ufric/s_pzd%40 | |||||
| formants voc/z_pzd+ufric/s_pzd%80 | |||||
| before _ voc/z_pzd_+ufric/s_pzd_%80 | |||||
| lengthmod 6 | lengthmod 6 | ||||
| switchvoicing s; | switchvoicing s; | ||||
| endphoneme | endphoneme | ||||
| vowelout f1=1 f2=2700 400 600 f3=200 70 rate len=70 | vowelout f1=1 f2=2700 400 600 f3=200 70 rate len=70 | ||||
| length 100 | length 100 | ||||
| lengthmod 3 | lengthmod 3 | ||||
| wave ufric/s_pzd%50 | |||||
| before _ ufric/s_pzd%50 | |||||
| wave ufric/s_pzd | |||||
| before _ ufric/s_pzd_ | |||||
| switchvoicing z; | switchvoicing z; | ||||
| endphoneme | endphoneme | ||||
| phoneme s. | |||||
| vls pla frc sibilant | |||||
| vowelin f1=0 f2=1800 -100 300 f3=-300 80 | |||||
| vowelout f1=0 f2=1800 -100 300 f3=-300 80 | |||||
| length 100 | |||||
| lengthmod 3 | |||||
| wave ufric/sh_rfx%80 | |||||
| before _ ufric/sh_rfx%60 | |||||
| switchvoicing z. | |||||
| endphoneme | |||||
| phoneme S; | phoneme S; | ||||
| vls pal frc sibilant palatal | vls pal frc sibilant palatal | ||||
| vowelin f1=1 f2=2700 400 600 f3=200 70 rate len=70 | vowelin f1=1 f2=2700 400 600 f3=200 70 rate len=70 |
| if((langopts.stress_flags & 0x1000) && (vowel_stress[1] == 0)) | if((langopts.stress_flags & 0x1000) && (vowel_stress[1] == 0)) | ||||
| { | { | ||||
| if((vowel_count == 3) && (vowel_stress[2] >= 4)) | |||||
| // If there is only one syllable before the primary stress, give it a secondary stress | |||||
| if((vowel_count > 2) && (vowel_stress[2] >= 4)) | |||||
| { | { | ||||
| // 2-syllable word, put a secondary stress on the initial syllable | |||||
| vowel_stress[1] = 3; | vowel_stress[1] = 3; | ||||
| } | } | ||||
| } | } |
| {PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | {PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | ||||
| 20, 25, 34, 20, drops_0, 3, 3, 15, 25, 0}, | 20, 25, 34, 20, drops_0, 3, 3, 15, 25, 0}, | ||||
| {PITCHdrop, 40, 2, PITCHdrop, 42,25, // exclamation | |||||
| {PITCHdrop, 38, 1, PITCHdrop, 42,25, // exclamation | |||||
| 20, 25, 34, 22, drops_0, 3, 3, 12, 8, 0}, | 20, 25, 34, 22, drops_0, 3, 3, 12, 8, 0}, | ||||
| ssml_sp->voice_variant = 0; | ssml_sp->voice_variant = 0; | ||||
| ssml_sp->voice_gender = 0; | ssml_sp->voice_gender = 0; | ||||
| ssml_sp->voice_age = 0; | ssml_sp->voice_age = 0; | ||||
| strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name)); | |||||
| strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language)); | |||||
| if(pvoice != NULL) | |||||
| { | |||||
| strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name)); | |||||
| strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language)); | |||||
| } | |||||
| current_voice_id[0] = 0; | current_voice_id[0] = 0; | ||||
| n_param_stack = 1; | n_param_stack = 1; |
| buf_length = 200; | buf_length = 200; | ||||
| outbuf_size = (buf_length * samplerate)/500; | outbuf_size = (buf_length * samplerate)/500; | ||||
| outbuf = (unsigned char*)realloc(outbuf,outbuf_size); | outbuf = (unsigned char*)realloc(outbuf,outbuf_size); | ||||
| out_start = outbuf; | |||||
| if((out_start = outbuf) == NULL) | |||||
| return(EE_INTERNAL_ERROR); | |||||
| // allocate space for event list. Allow 500 events per minute | // allocate space for event list. Allow 500 events per minute | ||||
| n_event_list = (buf_length*500)/1000; | n_event_list = (buf_length*500)/1000; | ||||
| event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list); | |||||
| if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL) | |||||
| return(EE_INTERNAL_ERROR); | |||||
| option_phonemes = 0; | option_phonemes = 0; | ||||
| #endif | #endif | ||||
| Free(event_list); | Free(event_list); | ||||
| event_list = NULL; | |||||
| Free(outbuf); | Free(outbuf); | ||||
| outbuf = NULL; | |||||
| FreePhData(); | FreePhData(); | ||||
| return EE_OK; | return EE_OK; |
| path: The directory which contains the espeak-data directory, or NULL for the default location. | path: The directory which contains the espeak-data directory, or NULL for the default location. | ||||
| Returns: sample rate in Hz | |||||
| Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR). | |||||
| */ | */ | ||||
| typedef int (t_espeak_callback)(short*, int, espeak_EVENT*); | typedef int (t_espeak_callback)(short*, int, espeak_EVENT*); |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.h" | #include "wave.h" | ||||
| const char *version_string = "1.24.03 06.May.07"; | |||||
| const char *version_string = "1.24.04 08.May.07"; | |||||
| const int version_phdata = 0x012201; | const int version_phdata = 0x012201; | ||||
| int option_device_number = -1; | int option_device_number = -1; |
| case L('f','r'): // french | case L('f','r'): // french | ||||
| { | { | ||||
| static int stress_lengths_fr[8] = {180, 180, 180, 180, 0, 0, 220, 220}; | |||||
| static int stress_lengths_fr[8] = {180, 160, 180, 190, 0, 0, 220, 220}; | |||||
| static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 }; | static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 }; | ||||
| tr = new Translator(); | tr = new Translator(); | ||||
| SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); | SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); | ||||
| tr->langopts.stress_rule = 3; // stress on final syllable | tr->langopts.stress_rule = 3; // stress on final syllable | ||||
| tr->langopts.stress_flags = 0x20; // don't use secondary stress | |||||
| tr->langopts.stress_flags = 0x0024; // don't use secondary stress | |||||
| tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables | tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables | ||||
| tr->langopts.numbers = 0x1509; | tr->langopts.numbers = 0x1509; |
| // bit6=light syllable followed by heavy, move secondary stress to the heavy syllable. LANG=Finnish | // bit6=light syllable followed by heavy, move secondary stress to the heavy syllable. LANG=Finnish | ||||
| // bit8=stress last syllable if it doesn't end in a vowel | // bit8=stress last syllable if it doesn't end in a vowel | ||||
| // bit9=stress last syllable if it doesn't end in vowel or "s" or "n" LANG=Spanish | // bit9=stress last syllable if it doesn't end in vowel or "s" or "n" LANG=Spanish | ||||
| // bit12= In 2-syllable words, give the first syllable a secondary stress | |||||
| // bit12= If there is only one syllable before the primary stress, give it a secondary stress | |||||
| int stress_flags; | int stress_flags; | ||||
| int unstressed_wd1; // stress for $u word of 1 syllable | int unstressed_wd1; // stress for $u word of 1 syllable |
| {"female", 2}, | {"female", 2}, | ||||
| {NULL, 0 }}; | {NULL, 0 }}; | ||||
| //int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0}; | |||||
| int tone_points[10] = {600,180, 1200,140, 2000,110, 3000,110, -1,0}; | |||||
| // limit the rate of change for each formant number | // limit the rate of change for each formant number | ||||
| //static int formant_rate_22050[9] = {50, 104, 165, 230, 220, 220, 220, 220, 220}; // values for 22kHz sample rate | //static int formant_rate_22050[9] = {50, 104, 165, 230, 220, 220, 220, 220, 220}; // values for 22kHz sample rate | ||||
| static int formant_rate_22050[9] = {50, 100, 165, 200, 200, 200, 200, 200, 200}; // values for 22kHz sample rate | static int formant_rate_22050[9] = {50, 100, 165, 200, 200, 200, 200, 200, 200}; // values for 22kHz sample rate | ||||
| const char *variant_lists[3] = {variants_either, variants_male, variants_female}; | const char *variant_lists[3] = {variants_either, variants_male, variants_female}; | ||||
| int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0}; | |||||
| void SetToneAdjust(voice_t *voice, int *tone_pts) | void SetToneAdjust(voice_t *voice, int *tone_pts) | ||||
| {//============================================== | {//============================================== | ||||
| } | } | ||||
| f_voice = fopen(buf,"r"); | f_voice = fopen(buf,"r"); | ||||
| if(first_voice == NULL) | |||||
| { | |||||
| first_voice = ReadVoiceFile(f_voice,buf+len_path_voices,voicename); | |||||
| rewind(f_voice); | |||||
| } | |||||
| language_type = "en"; // default | language_type = "en"; // default | ||||
| if(f_voice == NULL) | if(f_voice == NULL) | ||||
| language_type = voicename; | language_type = voicename; | ||||
| } | } | ||||
| if(first_voice == NULL) | |||||
| { | |||||
| first_voice = ReadVoiceFile(f_voice,buf+strlen(path_voices),voicename); | |||||
| rewind(f_voice); | |||||
| } | |||||
| if(!tone_only && (translator != NULL)) | if(!tone_only && (translator != NULL)) | ||||
| { | { | ||||
| delete translator; | delete translator; |