lang=hr: adjust phonemes [S tS tS; Z dZ dZ;] git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@173 d46cf337-b52f-0410-862d-fd96e6ae7743master
| _! 'aUs_|@-*,u:fe:ts,aIC@n | _! 'aUs_|@-*,u:fe:ts,aIC@n | ||||
| _? f@-*'Age:ts,aIC@n | _? f@-*'Age:ts,aIC@n | ||||
| _' 'apOst@-*,Of | _' 'apOst@-*,Of | ||||
| _" 'anf,y:*UNsts,aIC@n | |||||
| _" tsi:t'A:t | |||||
| _/ S@-*'Egst@-*IC | _/ S@-*'Egst@-*IC | ||||
| _( kl'am3||_|'aUf | _( kl'am3||_|'aUf | ||||
| _) kl'am3||ts'u: | _) kl'am3||ts'u: |
| Dictionary ro_dict | Dictionary ro_dict | ||||
| @ @- @I a aI aU e ea | |||||
| eI eU i I^ iI o Oa oI | |||||
| oU u uI y | |||||
| @ @- @I @U a aI aU e | |||||
| ea eI eU i I^ iI iU o | |||||
| Oa oI oU u uI y | |||||
| * *; b c d dZ f g | * *; b c d dZ f g | ||||
| h j k l m m; n p | h j k l m m; n p | ||||
| Dictionary ko_dict | Dictionary ko_dict | ||||
| a aI@ aU@ E e e: i i@3 | |||||
| IR ji o O~ u u- U@ V | |||||
| y: | |||||
| a e E i ji o u u- | |||||
| V | |||||
| b d dZ g h j k k` | |||||
| l m n N p p` r s | |||||
| s` t t` tS tS` w | |||||
| b c C c` ch d dZ g | |||||
| h j J k k` kh l m | |||||
| n N p p` ph r s S; | |||||
| s` t t` th w | |||||
| Dictionary hbs_dict | Dictionary hbs_dict | ||||
| Dictionary rw_dict | Dictionary rw_dict | ||||
| a a# e e# i i# o u | |||||
| u# | |||||
| a e i o u | |||||
| * : b B c d dZ f | * : b B c d dZ f | ||||
| g h j J k l m n | g h j J k l m n |
| disconsolate dIsk'0ns@l@t | disconsolate dIsk'0ns@l@t | ||||
| disc dIsk // for discs | disc dIsk // for discs | ||||
| disciple dIs'aIp@L | disciple dIs'aIp@L | ||||
| discourse $1 | |||||
| discounted $2 | discounted $2 | ||||
| disease dIz'i:z | disease dIz'i:z | ||||
| dishes dISIz | dishes dISIz | ||||
| donor doUn3 | donor doUn3 | ||||
| dont doUnt $only | dont doUnt $only | ||||
| dose doUs | dose doUs | ||||
| dosage doUsIdZ | |||||
| dramatic dr@matIk | dramatic dr@matIk | ||||
| drawer drO@ | drawer drO@ | ||||
| drier draI3 | drier draI3 | ||||
| live laIv $onlys | live laIv $onlys | ||||
| live lIv $verb | live lIv $verb | ||||
| livestock l'aIvst,0k | livestock l'aIvst,0k | ||||
| liver lIv3 | |||||
| lively laIvlI2 | lively laIvlI2 | ||||
| llama lA:m@ | llama lA:m@ | ||||
| loch l0x | loch l0x | ||||
| piteous pIti@s | piteous pIti@s | ||||
| pituitary $2 | pituitary $2 | ||||
| plaguing pleIgIN | plaguing pleIgIN | ||||
| plugin plVgIn | |||||
| plunging plVndZIN | plunging plVndZIN | ||||
| plus plVs | plus plVs | ||||
| poky poUkI2 | poky poUkI2 | ||||
| settee $2 | settee $2 | ||||
| severe sIv'i@3 $only | severe sIv'i@3 $only | ||||
| severely sIv'i@3lI2 $verbf | severely sIv'i@3lI2 $verbf | ||||
| sex sEks // sexism | |||||
| several sEvr@L | several sEvr@L | ||||
| shampoo $2 | shampoo $2 | ||||
| sheriff S'ErIf | sheriff S'ErIf | ||||
| trilogy trIl@dZI2 | trilogy trIl@dZI2 | ||||
| trio tri:oU | trio tri:oU | ||||
| trojan troUdZ@n | trojan troUdZ@n | ||||
| trolley tr0lI2 | |||||
| trophy troUfI2 | trophy troUfI2 | ||||
| truely tru:lI2 $verbf | truely tru:lI2 $verbf | ||||
| truest tru:@st | truest tru:@st |
| ann (eal a2n | ann (eal a2n | ||||
| ann (ih a2n | ann (ih a2n | ||||
| ann (oun a2n | ann (oun a2n | ||||
| ann (oy a2n | |||||
| _) ann (oy a2n | |||||
| ann (ui a2n | ann (ui a2n | ||||
| ann (ul a2n | ann (ul a2n | ||||
| ann (un a2n | ann (un a2n | ||||
| &) ella (_ 'El@ | &) ella (_ 'El@ | ||||
| &v) eller (_ @l@ | &v) eller (_ @l@ | ||||
| @) elli (_ 'ElI2 | @) elli (_ 'ElI2 | ||||
| &) elling @lI2N | |||||
| &) ell (ous @l | &) ell (ous @l | ||||
| cib) el (_ El | cib) el (_ El | ||||
| xc) el (_ 'El | xc) el (_ 'El | ||||
| gg g | gg g | ||||
| g (e dZ | g (e dZ | ||||
| _) gaol dZeIl | _) gaol dZeIl | ||||
| g) ged (_ gId | |||||
| g (eek g | g (eek g | ||||
| geous dZ=@s | geous dZ=@s | ||||
| g (E dZ | g (E dZ | ||||
| K) hl L | K) hl L | ||||
| &) hold (_$4 hoUld | &) hold (_$4 hoUld | ||||
| holme hoUm | holme hoUm | ||||
| &) hood (_S4 hUd | |||||
| &) hoods (_S5 hUdz | |||||
| _) h (our | _) h (our | ||||
| _) h (onor | _) h (onor | ||||
| _) h (onou | _) h (onou | ||||
| XC) iv (el Iv | XC) iv (el Iv | ||||
| _g) iv (e Iv | _g) iv (e Iv | ||||
| _l) iv (e Iv | _l) iv (e Iv | ||||
| l) iv (er Iv | |||||
| r) iv (er Iv | r) iv (er Iv | ||||
| dr) iv (er aIv | dr) iv (er aIv | ||||
| sh) iv (er Iv | sh) iv (er Iv | ||||
| y) ol (k oU | y) ol (k oU | ||||
| p) oll (u @l | p) oll (u @l | ||||
| r) oll oUl | r) oll oUl | ||||
| tr) oll (A 0l | |||||
| car) oll @l | car) oll @l | ||||
| br) oll 0l | br) oll 0l | ||||
| t) oll oUl | t) oll oUl | ||||
| rea (C% r,i:@ | rea (C% r,i:@ | ||||
| _) rea (dC r,i:@ | _) rea (dC r,i:@ | ||||
| rea (gen rI2eI | rea (gen rI2eI | ||||
| _) re (ali ,ri: | |||||
| _) re (all ,ri: | |||||
| _) re (au@P2 ,ri: | _) re (au@P2 ,ri: | ||||
| re (ck rE | re (ck rE | ||||
| reckon rEk@n | reckon rEk@n | ||||
| rea (l ri@ | rea (l ri@ | ||||
| ?3 rea (l ri: | ?3 rea (l ri: | ||||
| rea (lit rI2a | rea (lit rI2a | ||||
| rea (lloc rI2a | |||||
| _) rea (lloP2 ,ri: | |||||
| rea (lm rE | rea (lm rE | ||||
| rea (lte rI20 | rea (lte rI20 | ||||
| re (ment r@ | re (ment r@ | ||||
| _) tele tElI2 | _) tele tElI2 | ||||
| r) tga (g gI | r) tga (g gI | ||||
| &) tia (_ S@ | &) tia (_ S@ | ||||
| &s) tia (_ tS@ | |||||
| @) t (ia S | @) t (ia S | ||||
| pi) t (ia t | pi) t (ia t | ||||
| is) t (ian+ t | is) t (ian+ t | ||||
| @) u (ctive 'V | @) u (ctive 'V | ||||
| u (guC V | u (guC V | ||||
| f) u (gal 'ju: | f) u (gal 'ju: | ||||
| pl) ug Vg | |||||
| ug (er_ u:g | ug (er_ u:g | ||||
| s) ugge (st @dZE | s) ugge (st @dZE | ||||
| mp) ug (n ju: | mp) ug (n ju: | ||||
| y j | y j | ||||
| y (C_ I | y (C_ I | ||||
| y (CC I | y (CC I | ||||
| _) y (C@ I | |||||
| _) y (n@ V | |||||
| _) y (s@ V | |||||
| C) y (abl I2 | C) y (abl I2 | ||||
| y (y | y (y | ||||
| y (C I | y (C I |
| l l | l l | ||||
| K) l (K l- | K) l (K l- | ||||
| lj (+ l^ | lj (+ l^ | ||||
| v) lj lj | |||||
| .group m | .group m | ||||
| m m | m m | ||||
| rr R | rr R | ||||
| r (_ R | r (_ R | ||||
| K) r (K 'r- | |||||
| K) r (K R // ?? | |||||
| .group s | .group s |
| .group a | .group a | ||||
| a a | a a | ||||
| ai aI | ai aI | ||||
| ai (_ 'aI | |||||
| ai (a aj | |||||
| ai (_ 'aI | |||||
| au aU // ?? only at end of word ?? | au aU // ?? only at end of word ?? | ||||
| c) au (t au | |||||
| au (_ 'aU | au (_ 'aU | ||||
| a (AAA a | a (AAA a | ||||
| &) a (_S1q a | &) a (_S1q a | ||||
| gi) a (_S1q 'a | |||||
| gi) a (_S1q a | |||||
| V@) a (N_ 'a | V@) a (N_ 'a | ||||
| ăi) a (_ 'a | ăi) a (_ 'a | ||||
| @) abil (_ 'abil | @) abil (_ 'abil | ||||
| ă @ | ă @ | ||||
| ăi (_ @I | ăi (_ @I | ||||
| ău @U // ?? only at end of word ?? | ău @U // ?? only at end of word ?? | ||||
| c) ău (t @u | |||||
| ău (_ '@U | ău (_ '@U | ||||
| @) ăte (_S3t @te | @) ăte (_S3t @te | ||||
| @) ătă (_S3t @t@ | @) ătă (_S3t @t@ | ||||
| @) cnea (_ kne'a | @) cnea (_ kne'a | ||||
| .group d | .group d | ||||
| d d | d d | ||||
| dd d | dd d | ||||
| ei (_ eI | ei (_ eI | ||||
| // eu eU // only at end of word ?? | // eu eU // only at end of word ?? | ||||
| // eu e[u // ?? | // eu e[u // ?? | ||||
| eu (_ 'eU | |||||
| @) eu (l_ 'eu | |||||
| @) eu (_ eu | |||||
| @) eu (_N 'eU | |||||
| ea ea | ea ea | ||||
| &) ea (_S2q ea | &) ea (_S2q ea | ||||
| &) eSi eaj | &) eSi eaj | ||||
| @) eşului (_ =eSuluI | @) eşului (_ =eSuluI | ||||
| @) eşilor (_ =eSilor | @) eşilor (_ =eSilor | ||||
| @) ec (a_ =ek | |||||
| @) ec (ă_ =ek | |||||
| @) ec (ii_ =ek | |||||
| @) ec (ile_ =ek | |||||
| @) ec (ilor_ =ek | |||||
| @At) ec (i@_ etS | |||||
| @At) ec (A_ ek | |||||
| @At) ec (ii_ eTtS | |||||
| //@) ec (a_ =ek | |||||
| //@) ec (ă_ =ek | |||||
| //@) ec (ii_ =etS | |||||
| //@) ec (i_ =etS | |||||
| //@) ec (ilor_ =etS | |||||
| //@At) ec (i@_ etS | |||||
| //@At) ec (A_ ek | |||||
| @At) ec (ii_ etS | |||||
| // &) es (_S1q e | // &) es (_S1q e | ||||
| &C) e (re_ %e | &C) e (re_ %e | ||||
| _ac) ee (a eI | _ac) ee (a eI | ||||
| r) ei (er_ 'eI | r) ei (er_ 'eI | ||||
| @) e (re_ =e | @) e (re_ =e | ||||
| @) e (ri_ =e | @) e (ri_ =e | ||||
| @) e (rea_ =e | @) e (rea_ =e | ||||
| @) e (rii_ =e | @) e (rii_ =e | ||||
| @) e (rei_ =e | |||||
| i) e (re_ e | i) e (re_ e | ||||
| i) e (ri_ e | i) e (ri_ e | ||||
| i) e (rii_ e | i) e (rii_ e | ||||
| g (i dZ | g (i dZ | ||||
| gii dZiI | gii dZiI | ||||
| gh g | gh g | ||||
| &) gii (_ dZ'iI | |||||
| &) gi (A_ dZi | |||||
| .group h | .group h | ||||
| &) icile (_ =itSile | &) icile (_ =itSile | ||||
| &) icilor (_ =itSilor | &) icilor (_ =itSilor | ||||
| @) icii (_ =itSiI | @) icii (_ =itSiI | ||||
| @) icei (_ =itSeI | |||||
| scr) i (e 'i | scr) i (e 'i | ||||
| &) ing (_ %iNg // foreign words | &) ing (_ %iNg // foreign words | ||||
| &) le (_S2t le | &) le (_S2t le | ||||
| &) lor (_S3t lor | &) lor (_S3t lor | ||||
| &) lui (_S3t luI | &) lui (_S3t luI | ||||
| &) logi (A_ lodZ'i | |||||
| &) logii (_ lodZ'iI | |||||
| .group m | .group m | ||||
| _) oi oI | _) oi oI | ||||
| oi (_ 'oI | oi (_ 'oI | ||||
| ou oU | ou oU | ||||
| ou (_ 'oU | |||||
| ou (_N 'oU | |||||
| ou (_ ou | |||||
| o (AAA o | o (AAA o | ||||
| .group u | .group u | ||||
| u u | |||||
| u (A w | |||||
| _) ui uI | |||||
| ui (_ uI | |||||
| ui (e wi | |||||
| V&) ui (_N u'i | |||||
| u u | |||||
| u (A w | |||||
| _) ui uI | |||||
| ui (_ 'uI | |||||
| r) ui (n ui | |||||
| ui (e wi | |||||
| V&) ui (_N u'i | |||||
| dest) ul ul | |||||
| &) ul (_S2t ul | &) ul (_S2t ul | ||||
| @ic) ul (_S2t ul | @ic) ul (_S2t ul | ||||
| @ic) ule (_S3t ule | @ic) ule (_S3t ule | ||||
| .group x | .group x | ||||
| x ks | |||||
| A) x (A gz | |||||
| ma) x (i ks | |||||
| cone) x (iu ks | |||||
| i) x (e ks | |||||
| o) x (e ks // boxele | |||||
| u) x (a ks | |||||
| a) x (a ks | |||||
| a) x (ă ks | |||||
| a) x (e ks | |||||
| i) x (a ks | |||||
| o) x (a ks | |||||
| A) x (â ks | |||||
| @) x (ibil ks | |||||
| o) x (i ks // oxigen | |||||
| a) x (ia ks // axial | |||||
| ale) x ks | |||||
| ta) x ks | |||||
| x ks | |||||
| e) x (a gz | |||||
| e) x (e gz | |||||
| e) x (i gz | |||||
| me) x (ic ks | |||||
| e) x (iA_ ks | |||||
| e) x (iu ks | |||||
| e) x (Ag ks | |||||
| le) x ks | |||||
| .group y | .group y | ||||
| D_) % la_sut@ | D_) % la_sut@ | ||||
| % p@-*otSent | % p@-*otSent | ||||
| $ dolar | $ dolar | ||||
| + plus | |||||
| & ampersand | |||||
| © k'apiraIt | |||||
| @ a*'ond | |||||
| / sleS | |||||
| € 'eU*o | |||||
| ° g@-*ade | |||||
| , (D v'irgul@ | , (D v'irgul@ | ||||
| **) * (_ _:: | **) * (_ _:: | ||||
| e (Dn @ //en eng | e (Dn @ //en eng | ||||
| er @r | |||||
| e1r @r55 | |||||
| e2r @r35 | |||||
| e3r @r214 | |||||
| e4r @r51 | |||||
| er (K @r | |||||
| e1r (K @r55 | |||||
| e2r (K @r35 | |||||
| e3r (K @r214 | |||||
| e4r (K @r51 | |||||
| .group f | .group f | ||||
| f f | f f |
| pl 15 109 | pl 15 109 | ||||
| sk 29 127 | sk 29 127 | ||||
| cs 6 127 | cs 6 127 | ||||
| hr 20 132 | |||||
| hr 26 132 | |||||
| mk 3 133 | mk 3 133 | ||||
| sr 14 132 | sr 14 132 | ||||
| ru 39 129 | ru 39 129 | ||||
| tr 18 122 | tr 18 122 | ||||
| ku 17 121 | ku 17 121 | ||||
| id 15 119 | id 15 119 | ||||
| rw 12 122 | |||||
| ko 18 114 | |||||
| rw 15 124 | |||||
| ko 18 145 | |||||
| Data file Used by | Data file Used by | ||||
| b/b [b] base | b/b [b] base | ||||
| [dZ;] base | [dZ;] base | ||||
| [dz;] base | [dz;] base | ||||
| [J] hi | [J] hi | ||||
| [dZ] hr | |||||
| [dZ;] hr | |||||
| [dZ;] mk | [dZ;] mk | ||||
| [dZ;] ru | [dZ;] ru | ||||
| dzh/dzh2 [dZ] hr | |||||
| [dZ;] hr | |||||
| dzh/dz_pzd [J] base | dzh/dz_pzd [J] base | ||||
| [J2] hi | [J2] hi | ||||
| [J] tr | [J] tr | ||||
| [dZ;] base | [dZ;] base | ||||
| [dz;] base | [dz;] base | ||||
| [J] hi | [J] hi | ||||
| [dZ] hr | |||||
| [dZ;] hr | |||||
| [dZ;] mk | [dZ;] mk | ||||
| [dZ;] ru | [dZ;] ru | ||||
| dzh/xdz_pzd [J] base | dzh/xdz_pzd [J] base | ||||
| [J2] hi | [J2] hi | ||||
| envelope/i_risefall [11] zh | envelope/i_risefall [11] zh | ||||
| envelope/i_risefall2 [+2] rw | |||||
| envelope/p_214 [214] zh | envelope/p_214 [214] zh | ||||
| envelope/p_512 [8] vi | envelope/p_512 [8] vi | ||||
| envelope/p_fall [2] vi | envelope/p_fall [2] vi | ||||
| [22] zh | [22] zh | ||||
| [33] zh | [33] zh | ||||
| [53] zh | [53] zh | ||||
| [+] rw | |||||
| envelope/p_fallrise [4] vi | envelope/p_fallrise [4] vi | ||||
| envelope/p_level [1] vi | envelope/p_level [1] vi | ||||
| [3] zhy | [3] zhy | ||||
| ufric/sh_ [S] base | ufric/sh_ [S] base | ||||
| [S] fr | [S] fr | ||||
| [s#] pt_pt | [s#] pt_pt | ||||
| ufric/sh3 [S] hr | |||||
| [Z] hr | |||||
| ufric/sh_pzd [S;] base | ufric/sh_pzd [S;] base | ||||
| [S;] ro | [S;] ro | ||||
| [s`] ko | |||||
| ufric/sh_pzd_ [S;] base | ufric/sh_pzd_ [S;] base | ||||
| [Z;] base | [Z;] base | ||||
| ufric/sh_pzd2 [S] sr | ufric/sh_pzd2 [S] sr | ||||
| [c] zhy | [c] zhy | ||||
| ustop/tsh_ [tS] base | ustop/tsh_ [tS] base | ||||
| [c] zhy | [c] zhy | ||||
| ustop/tsh2 [tS] hr | |||||
| [dZ] hr | |||||
| ustop/t_short [t.] hi | ustop/t_short [t.] hi | ||||
| [t] sk | [t] sk | ||||
| [t] el | [t] el | ||||
| [ts;] base | [ts;] base | ||||
| [ch] hi | [ch] hi | ||||
| [tS;] ru | [tS;] ru | ||||
| [tS`] ko | |||||
| ustop/ts_pzd_ [c] hi | ustop/ts_pzd_ [c] hi | ||||
| [c] hu | [c] hu | ||||
| ustop/ts_pzd2 [c] hi | ustop/ts_pzd2 [c] hi | ||||
| [c] hu | [c] hu | ||||
| [c`] ko | |||||
| ustop/ts_pzd3 [tS;] hr | |||||
| [dZ;] hr | |||||
| ustop/t_sr [d] sr | ustop/t_sr [d] sr | ||||
| [t] sr | [t] sr | ||||
| ustop/ts_rfx [ts.] zh | ustop/ts_rfx [ts.] zh | ||||
| voc/zh [Z] base | voc/zh [Z] base | ||||
| [z.] base | [z.] base | ||||
| [R^] sk | [R^] sk | ||||
| [Z] hr | |||||
| [Z] sr | [Z] sr | ||||
| [Z;] ro | [Z;] ro | ||||
| voc/zh_ [Z] base | voc/zh_ [Z] base | ||||
| [z.] base | [z.] base | ||||
| [Z] hr | |||||
| [Z;] ro | [Z;] ro | ||||
| voc/zh_2 [R^/] sk | voc/zh_2 [R^/] sk | ||||
| voc/z_pzd [Z;] base | voc/z_pzd [Z;] base |
| 0 aI@ NULL 60 aI @ | 0 aI@ NULL 60 aI @ | ||||
| 0 aU@ NULL 75 aU @ | 0 aU@ NULL 75 aU @ | ||||
| 0 x NULL 0 k | 0 x NULL 0 k | ||||
| 0 t2 NULL 0 t | |||||
| 0 a e 15 a _ | 0 a e 15 a _ | ||||
| 0 a NULL 0 a | 0 a NULL 0 a | ||||
| 0 @- NULL 0 NULL | 0 @- NULL 0 NULL | ||||
| 0 j NULL 0 i | |||||
| 0 j/ NULL 0 j | 0 j/ NULL 0 j | ||||
| 0 I^ _ 0 I | 0 I^ _ 0 I | ||||
| 0 I^ NULL 20 I _ | 0 I^ NULL 20 I _ |
| 0 p NULL 0 p_h | 0 p NULL 0 p_h | ||||
| 0 t NULL 0 t_h | 0 t NULL 0 t_h | ||||
| 0 k NULL 0 k_h | 0 k NULL 0 k_h | ||||
| 0 t2 NULL 0 t |
| 0 U@ NULL 50 U r | 0 U@ NULL 50 U r | ||||
| 0 i@ NULL 50 I @ | 0 i@ NULL 50 I @ | ||||
| 0 i@3 NULL 60 i r | 0 i@3 NULL 60 i r | ||||
| 0 t2 NULL 0 t | |||||
| phoneme S // this is letter š | |||||
| vls pla frc sibilant | |||||
| vowelin f1=0 f2=2100 100 300 f3=-100 80 | |||||
| vowelout f1=0 f2=2100 100 300 f3=-100 80 | |||||
| length 30 | |||||
| lengthmod 3 | |||||
| wave ufric/sh3%220 | |||||
| before _ ufric/sh3%160 | |||||
| switchvoicing Z | |||||
| endphoneme | |||||
| phoneme tS // this is letter č | |||||
| vls pla afr sibilant | |||||
| vowelin f1=0 f2=1900 100 200 f3=-100 80 | |||||
| length 90 | |||||
| lengthmod 2 | |||||
| wave ustop/tsh2 | |||||
| before _ ustop/tsh2%70 | |||||
| switchvoicing dZ | |||||
| endphoneme | |||||
| phoneme tS; // this is letter ć | |||||
| vls pal afr sibilant palatal | |||||
| vowelin f1=0 f2=2500 300 500 f3=300 80 rate len=70 | |||||
| lengthmod 2 | |||||
| wave ustop/ts_pzd3 | |||||
| before _ ustop/ts_pzd3%80 | |||||
| switchvoicing dZ; | |||||
| endphoneme | |||||
| phoneme Z // letter ž | |||||
| vcd pla frc sibilant | |||||
| vowelin f1=0 f2=2000 0 300 f3=-200 80 | |||||
| vowelout f1=2 f2=2000 0 300 f3=-200 80 brk | |||||
| formants voc/zh+ufric/sh3%240 | |||||
| before _ voc/zh_+ufric/sh3%170 | |||||
| lengthmod 6 | |||||
| switchvoicing S | |||||
| endphoneme | |||||
| phoneme dZ //letter dž | |||||
| vcd pla afr sibilant | |||||
| vowelin f1=2 f2=1900 100 300 f3=100 80 | |||||
| vowelout f1=2 f2=1900 100 300 f3=100 80 brk | |||||
| formants dzh/dzh2+ustop/tsh2%140 | |||||
| before _ dzh/dzh_+ustop/tsh2%100 | |||||
| after _ NULL | |||||
| after @ dzh/xdzh | |||||
| lengthmod 5 | |||||
| switchvoicing tS | |||||
| endphoneme | |||||
| phoneme dZ; // letter đ | |||||
| vcd pla afr sibilant palatal | |||||
| vowelin f1=2 f2=2500 300 500 f3=300 80 rate len=70 | |||||
| formants dzh/dzh2+ustop/ts_pzd3%140 | |||||
| before _ dzh/dzh_+ustop/ts_pzd3%80 | |||||
| after _ NULL | |||||
| after @ dzh/xdzh | |||||
| lengthmod 5 | |||||
| switchvoicing tS; | |||||
| endphoneme | |||||
| phoneme @ // Schwa | phoneme @ // Schwa | ||||
| vowel starttype (@) endtype (@) | vowel starttype (@) endtype (@) | ||||
| formants vowel/@_hgh | formants vowel/@_hgh | ||||
| length 50 | length 50 | ||||
| endphoneme | endphoneme | ||||
| //****************************** | |||||
| // Phonemes for Kinyarwanda (rw), inherits "base2" | |||||
| //****************************** | |||||
| phoneme a | |||||
| vowel starttype (a) endtype (a) | |||||
| length 180 | |||||
| formants vowel/a_2 | |||||
| reduceto a/ 4 | |||||
| beforepause a# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme a/ | |||||
| vowel starttype (@) endtype (@) | |||||
| length 180 | |||||
| formants vowel/a# | |||||
| beforepause a# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme e | |||||
| vowel starttype (e) endtype (e) | |||||
| length 170 | |||||
| formants vowel/e | |||||
| beforepause e# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme i | |||||
| vowel starttype (i) endtype (i) | |||||
| length 150 | |||||
| formants vowel/i | |||||
| beforepause i# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme o | |||||
| vowel starttype (o) endtype (o) | |||||
| length 170 | |||||
| formants vowel/o | |||||
| beforepause o# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme u | |||||
| vowel starttype (u) endtype (u) | |||||
| length 160 | |||||
| formants vowel/u_bck | |||||
| beforepause u# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme a# | |||||
| vowel starttype (@) endtype (@) | |||||
| length 100 | |||||
| formants vowel/a# | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme e# | |||||
| vowel starttype (e) endtype (e) | |||||
| length 100 | |||||
| formants vowel/e | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme i# | |||||
| vowel starttype (i) endtype (i) | |||||
| length 100 | |||||
| formants vowel/i | |||||
| linkout ; | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme o# | |||||
| vowel starttype (o) endtype (o) | |||||
| length 170 | |||||
| formants vowel/o | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme u# | |||||
| vowel starttype (u) endtype (u) | |||||
| length 100 | |||||
| formants vowel/u_bck | |||||
| beforevowel NULL | |||||
| endphoneme | |||||
| phoneme : // Lengthen previous vowel by "length" | |||||
| virtual | |||||
| length 120 | |||||
| endphoneme | |||||
| phoneme + // high tone, use after a vowel | |||||
| stress | |||||
| tone 0 30 envelope/p_fall NULL | |||||
| endphoneme | |||||
| phoneme +2 // high tone, use after a vowel | |||||
| stress | |||||
| tone 0 30 envelope/i_risefall2 NULL | |||||
| endphoneme | |||||
| phoneme a | |||||
| vowel starttype (a) endtype (a) | |||||
| length 190 | |||||
| formants vowel/a | |||||
| endphoneme | |||||
| phoneme E | |||||
| vowel starttype (e) endtype (e) | |||||
| length 180 | |||||
| formants vowel/e_mid2 | |||||
| endphoneme | |||||
| phoneme e | |||||
| vowel starttype (e) endtype (e) | |||||
| length 180 | |||||
| formants vowel/e | |||||
| endphoneme | |||||
| phoneme i | |||||
| vowel starttype (i) endtype (i) | |||||
| length 160 | |||||
| formants vowel/i | |||||
| endphoneme | |||||
| phoneme o | |||||
| vowel starttype (o) endtype (o) | |||||
| length 180 | |||||
| formants vowel/o_2 | |||||
| endphoneme | |||||
| phoneme V | |||||
| vowel starttype (a) endtype (a) | |||||
| length 180 | |||||
| formants vowel/aa_8 | |||||
| endphoneme | |||||
| phoneme Y | |||||
| vowel starttype (@) endtype (@) | |||||
| length 180 | |||||
| formants vowel/y# | |||||
| endphoneme | |||||
| phoneme u | |||||
| vowel starttype (u) endtype (u) | |||||
| length 180 | |||||
| formants vowel/u_bck | |||||
| endphoneme | |||||
| phoneme y | |||||
| vowel starttype (i) endtype (u) | |||||
| length 180 | |||||
| formants vowel/u#_6 | |||||
| endphoneme | |||||
| phoneme u- | |||||
| vowel starttype (u) endtype (u) | |||||
| length 180 | |||||
| formants vowel/u_unr | |||||
| endphoneme | |||||
| phoneme ji | |||||
| vowel starttype (i) endtype (i) | |||||
| length 220 | |||||
| formants vdiph/yi_fr | |||||
| endphoneme | |||||
| phoneme p` | |||||
| vls blb stop | |||||
| vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=31 | |||||
| vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=30 | |||||
| lengthmod 2 | |||||
| wave ustop/p_unasp%130 | |||||
| endphoneme | |||||
| phoneme t` // dental variant of /t/ | |||||
| vls dnt stop | |||||
| vowelin f1=0 f2=1600 -300 300 f3=-100 80 amp=31 | |||||
| vowelout f1=0 f2=1600 -300 250 f3=-100 80 rms=20 | |||||
| lengthmod 2 | |||||
| wave ustop/t_dnt | |||||
| switchvoicing d | |||||
| endphoneme | |||||
| phoneme c` | |||||
| vls pal afr sibilant palatal | |||||
| vowelin f1=0 f2=2700 400 600 f3=300 80 rate len=70 amp=31 | |||||
| lengthmod 2 | |||||
| wave ustop/ts_pzd2%120 | |||||
| switchvoicing dZ; | |||||
| endphoneme | |||||
| phoneme k` | |||||
| vls vel stop | |||||
| vowelin f1=0 f2=2300 200 400 f3=-100 80 amp=31 | |||||
| vowelout f1=0 f2=2300 300 400 f3=-100 80 rms=20 | |||||
| lengthmod 2 | |||||
| wave ustop/k_unasp%130 | |||||
| endphoneme | |||||
| phoneme s` | |||||
| vls alv frc sibilant | |||||
| vowelin f1=0 f2=1700 -300 300 f3=-100 80 amp=31 | |||||
| vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 | |||||
| lengthmod 3 | |||||
| wave ufric/s%120 | |||||
| before j ufric/sh_pzd%120 | |||||
| before i ufric/sh_pzd%120 | |||||
| endphoneme | |||||
| phoneme r // flap [**] | |||||
| liquid alv | |||||
| beforenotvowel l | |||||
| vowelout f1=3 f2=1600 -300 300 f3=-300 80 rms=35 len=15 | |||||
| vowelin f1=2 f2=1600 -300 300 f3=-100 80 len=20 | |||||
| formants r3/@tap | |||||
| after (e) r3/@tap2 | |||||
| after (i) r3/@tap2 | |||||
| lengthmod 3 | |||||
| endphoneme | |||||
| phonemetable rw base2 | phonemetable rw base2 | ||||
| include ph_kinyarwanda | include ph_kinyarwanda | ||||
| phonemetable ko base | |||||
| phonemetable ko hi | |||||
| include ph_korean | include ph_korean |
| # remove -fno-exceptions if it causes problems with stdio library on some platforms (ARM) | # remove -fno-exceptions if it causes problems with stdio library on some platforms (ARM) | ||||
| PREFIX=/ | |||||
| BINDIR=$(PREFIX)/usr/bin | |||||
| INCDIR=$(PREFIX)/usr/include/espeak | |||||
| LIBDIR=$(PREFIX)/usr/lib | |||||
| DATADIR=$(PREFIX)/usr/share/espeak-data | |||||
| PREFIX=/usr | |||||
| BINDIR=$(PREFIX)/bin | |||||
| INCDIR=$(PREFIX)/include/espeak | |||||
| LIBDIR=$(PREFIX)/lib | |||||
| DATADIR=$(PREFIX)/share/espeak-data | |||||
| RELEASE = 1.36 | RELEASE = 1.36 | ||||
| BIN_NAME = speak | BIN_NAME = speak | ||||
| LN_SF = /bin/ln -sf | LN_SF = /bin/ln -sf | ||||
| MKDIR = mkdir -p | MKDIR = mkdir -p | ||||
| #AUDIO = pulseaudio | |||||
| AUDIO = portaudio | AUDIO = portaudio | ||||
| #AUDIO = pulseaudio | |||||
| #AUDIO = sada | |||||
| ifeq ($(AUDIO),pulseaudio) | ifeq ($(AUDIO),pulseaudio) | ||||
| WAVE=wave_pulse.cpp | WAVE=wave_pulse.cpp | ||||
| LIB_AUDIO=-lportaudio | LIB_AUDIO=-lportaudio | ||||
| USE_AUDIO=-DUSE_PORTAUDIO | USE_AUDIO=-DUSE_PORTAUDIO | ||||
| else | else | ||||
| ifeq ($(AUDIO),sada) | |||||
| WAVE=wave_sada.cpp | |||||
| USE_AUDIO=-DUSE_SADA | |||||
| else | |||||
| WAVE=wave.cpp | WAVE=wave.cpp | ||||
| endif | endif | ||||
| endif | endif | ||||
| endif | |||||
| speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ | speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ | ||||
| readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ | readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ |
| switch(langopts.stress_rule) | switch(langopts.stress_rule) | ||||
| { | { | ||||
| case 8: | |||||
| // stress on first syllable, unless it is a light syllable | |||||
| if(syllable_weight[1] > 0) | |||||
| break; | |||||
| // else drop through to case 1 | |||||
| case 1: | |||||
| // stress on second syllable | |||||
| if((stressed_syllable == 0) && (vowel_count > 2)) | |||||
| { | |||||
| stressed_syllable = 2; | |||||
| if(max_stress == 0) | |||||
| { | |||||
| vowel_stress[stressed_syllable] = 4; | |||||
| } | |||||
| max_stress = 4; | |||||
| } | |||||
| break; | |||||
| case 2: | case 2: | ||||
| // a language with stress on penultimate vowel | // a language with stress on penultimate vowel | ||||
| int count; | int count; | ||||
| int n_primary; | int n_primary; | ||||
| int count_primary; | int count_primary; | ||||
| PHONEME_TAB *ph; | |||||
| int ph_end=n_phoneme_list; | int ph_end=n_phoneme_list; | ||||
| SYLLABLE syllable_tab2[N_PHONEME_LIST]; | SYLLABLE syllable_tab2[N_PHONEME_LIST]; | ||||
| p->pitch2 = x; | p->pitch2 = x; | ||||
| } | } | ||||
| if(p->tone_ph) | |||||
| { | |||||
| ph = phoneme_tab[p->tone_ph]; | |||||
| x = (p->pitch1 + p->pitch2)/2; | |||||
| p->pitch2 = x + ph->end_type; | |||||
| p->pitch1 = x + ph->start_type; | |||||
| } | |||||
| if(syl->flags & SYL_EMPHASIS) | if(syl->flags & SYL_EMPHASIS) | ||||
| { | { |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.h" | #include "wave.h" | ||||
| const char *version_string = "1.36.07 25.Mar.08"; | |||||
| const char *version_string = "1.36.12 10.Apr.08"; | |||||
| const int version_phdata = 0x013400; | const int version_phdata = 0x013400; | ||||
| int option_device_number = -1; | int option_device_number = -1; |
| #define OFFSET_CYRILLIC 0x420 | #define OFFSET_CYRILLIC 0x420 | ||||
| #define OFFSET_DEVANAGARI 0x900 | #define OFFSET_DEVANAGARI 0x900 | ||||
| #define OFFSET_TAMIL 0xb80 | #define OFFSET_TAMIL 0xb80 | ||||
| #define OFFSET_KOREAN 0x1100 | |||||
| static const unsigned int replace_cyrillic_latin[] = | static const unsigned int replace_cyrillic_latin[] = | ||||
| break; | break; | ||||
| case L('k','o'): // Korean, TEST | case L('k','o'): // Korean, TEST | ||||
| { | |||||
| static const char ko_ivowels[] = {0x63,0x64,0x67,0x68,0x6d,0x72,0x74,0x75,0}; // y and i vowels | |||||
| static const char ko_voiced[] = {0x02,0x05,0x06,0xab,0xaf,0xb7,0xbc,0}; // voiced consonants, l,m,n,N | |||||
| tr = new Translator(); | tr = new Translator(); | ||||
| tr->letter_bits_offset = OFFSET_KOREAN; | |||||
| memset(tr->letter_bits,0,sizeof(tr->letter_bits)); | |||||
| SetLetterBitsRange(tr,LETTERGP_A,0x61,0x75); | |||||
| SetLetterBits(tr,LETTERGP_Y,ko_ivowels); | |||||
| SetLetterBits(tr,LETTERGP_G,ko_voiced); | |||||
| tr->langopts.stress_rule = 8; // ?? 1st syllable if it is heavy, else 2nd syllable | |||||
| tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words | tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words | ||||
| tr->langopts.numbers = 0x0401; | |||||
| } | |||||
| break; | break; | ||||
| case L('k','u'): // Kurdish | case L('k','u'): // Kurdish | ||||
| SetupTranslator(tr,stress_lengths_ta,stress_amps_ta); | SetupTranslator(tr,stress_lengths_ta,stress_amps_ta); | ||||
| tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable | tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable | ||||
| tr->langopts.stress_rule = 1; | |||||
| tr->langopts.stress_rule = 0; | |||||
| tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable | tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable | ||||
| tr->letter_bits_offset = OFFSET_TAMIL; | tr->letter_bits_offset = OFFSET_TAMIL; | ||||
| tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels betwen words | tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels betwen words |
| /*************************************************************************** | |||||
| * Copyright (C) 2008, Sun Microsystems, Inc. * | |||||
| * eSpeak driver for Solaris Audio Device Architecture (SADA) * | |||||
| * Written by Willie Walker, based on the eSpeak PulseAudio driver * | |||||
| * from Gilles Casse * | |||||
| * * | |||||
| * This program is free software; you can redistribute it and/or modify * | |||||
| * it under the terms of the GNU General Public License as published by * | |||||
| * the Free Software Foundation; either version 3 of the License, or * | |||||
| * (at your option) any later version. * | |||||
| * * | |||||
| * This program is distributed in the hope that it will be useful, * | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |||||
| * GNU General Public License for more details. * | |||||
| * * | |||||
| * You should have received a copy of the GNU General Public License * | |||||
| * along with this program; if not, write to the * | |||||
| * Free Software Foundation, Inc., * | |||||
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |||||
| ***************************************************************************/ | |||||
| #include "speech.h" | |||||
| #ifdef USE_ASYNC | |||||
| // This source file is only used for asynchronious modes | |||||
| #include <errno.h> | |||||
| #include <string.h> | |||||
| #include <stropts.h> | |||||
| #include <assert.h> | |||||
| #include <stdlib.h> | |||||
| #include <unistd.h> | |||||
| #include <fcntl.h> | |||||
| #include <sys/audioio.h> | |||||
| #include "wave.h" | |||||
| #include "debug.h" | |||||
| enum {ONE_BILLION=1000000000}; | |||||
| #define SAMPLE_RATE 22050 | |||||
| #define SAMPLE_SIZE 16 | |||||
| #ifdef USE_SADA | |||||
| static t_wave_callback* my_callback_is_output_enabled=NULL; | |||||
| static const char *sun_audio_device = "/dev/audio"; | |||||
| static int sun_audio_fd = -1; | |||||
| // The total number of 16-bit samples sent to be played via the | |||||
| // wave_write method. | |||||
| // | |||||
| static uint32_t total_samples_sent; | |||||
| // The total number of samples sent to be played via the wave_write | |||||
| // method, but which were never played because of a call to | |||||
| // wave_close. | |||||
| // | |||||
| static uint32_t total_samples_skipped; | |||||
| // The last known playing index after a call to wave_close. | |||||
| // | |||||
| static uint32_t last_play_position=0; | |||||
| //> | |||||
| // wave_init | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // initializes the audio subsytem. | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // sun_audio_fd: modified to hold the file descriptor of the opened | |||||
| // audio device. | |||||
| // | |||||
| //<wave_init | |||||
| void wave_init() { | |||||
| ENTER("wave_init"); | |||||
| audio_info_t ainfo; | |||||
| char *audio_device = NULL; | |||||
| audio_device = getenv("AUDIODEV"); | |||||
| if (audio_device != NULL) { | |||||
| if ((sun_audio_fd = open(audio_device, O_WRONLY)) < 0) { | |||||
| SHOW("wave_init() could not open: %s (%d)\n", | |||||
| audio_device, sun_audio_fd); | |||||
| } | |||||
| } | |||||
| if (sun_audio_fd < 0) { | |||||
| if ((sun_audio_fd = open(sun_audio_device, O_WRONLY)) < 0) { | |||||
| SHOW("wave_init() could not open: %s (%d)\n", | |||||
| sun_audio_device, sun_audio_fd); | |||||
| } | |||||
| } | |||||
| SHOW("wave_init() sun_audio_fd: %d\n", sun_audio_fd); | |||||
| if (sun_audio_fd < 0) { | |||||
| return; | |||||
| } | |||||
| ioctl(sun_audio_fd, AUDIO_GETINFO, &ainfo); | |||||
| SHOW("wave_init() play buffer size: %d\n", ainfo.play.buffer_size); | |||||
| ainfo.play.encoding = AUDIO_ENCODING_LINEAR; | |||||
| ainfo.play.channels = 1; | |||||
| ainfo.play.sample_rate = SAMPLE_RATE; | |||||
| ainfo.play.precision = SAMPLE_SIZE; | |||||
| if (ioctl(sun_audio_fd, AUDIO_SETINFO, &ainfo) == -1) { | |||||
| SHOW("wave_init() failed to set audio params: %s\n", strerror(errno)); | |||||
| close(sun_audio_fd); | |||||
| return; | |||||
| } | |||||
| } | |||||
| //> | |||||
| // wave_open | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // opens the audio subsystem given a specific API (e.g., "alsa", | |||||
| // "oss", ...). We ignore the_api and just return the sun_audio_fd we | |||||
| // opened in wave_init. This return value will be passed in as the | |||||
| // theHandler parameter in all other methods. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // the_api: "alsa", "oss" (ignored) | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // sun_audio_fd: used as return value | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // sun_audio_fd opened in wave_init, which is passed in as theHandler | |||||
| // parameter in all other methods | |||||
| // | |||||
| //<wave_open | |||||
| void* wave_open(const char* the_api) | |||||
| { | |||||
| ENTER("wave_open"); | |||||
| return((void*) sun_audio_fd); | |||||
| } | |||||
| //> | |||||
| // wave_write | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Meant to be asynchronous, it supplies the wave sample to the lower | |||||
| // audio layer and returns. The sample is played later on. [[[WDW - | |||||
| // we purposely do not open the audio device as non-blocking because | |||||
| // managing that would be a pain. So, we rely a lot upon fifo.cpp and | |||||
| // event.cpp to not overload us, allowing us to get away with a | |||||
| // blocking write. event.cpp:polling_thread in particular appears to | |||||
| // use get_remaining_time to prevent flooding.]]] | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // theMono16BitsWaveBuffer: the audio data | |||||
| // theSize: the number of bytes (not 16-bit samples) | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // total_samples_sent: modified based upon 16-bit samples sent | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // the number of bytes (not 16-bit samples) sent | |||||
| // | |||||
| //<wave_write | |||||
| size_t wave_write(void* theHandler, | |||||
| char* theMono16BitsWaveBuffer, | |||||
| size_t theSize) | |||||
| { | |||||
| size_t num; | |||||
| ENTER("wave_write"); | |||||
| if (my_callback_is_output_enabled && (0==my_callback_is_output_enabled())) { | |||||
| SHOW_TIME("wave_write > my_callback_is_output_enabled: no!"); | |||||
| return 0; | |||||
| } | |||||
| num = write((int) theHandler, theMono16BitsWaveBuffer, theSize); | |||||
| // Keep track of the total number of samples sent -- we use this in | |||||
| // wave_get_read_position and also use it to help calculate the | |||||
| // total_samples_skipped in wave_close. | |||||
| // | |||||
| total_samples_sent += num / 2; | |||||
| if (num < theSize) { | |||||
| SHOW("ERROR: wave_write only wrote %d of %d bytes\n", num, theSize); | |||||
| } else { | |||||
| SHOW("wave_write wrote %d bytes\n", theSize); | |||||
| } | |||||
| SHOW_TIME("wave_write > LEAVE"); | |||||
| return num; | |||||
| } | |||||
| //> | |||||
| // wave_close | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Does what SADA normally would call a flush, which means to cease | |||||
| // all audio production in progress and throw any remaining audio | |||||
| // away. [[[WDW - see comment in wave_flush.]]] | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // last_play_position: modified to reflect play position the last time | |||||
| // this method was called | |||||
| // total_samples_sent: used to help calculate total_samples_skipped | |||||
| // total_samples_skipped: modified to hold the total number of 16-bit | |||||
| // samples sent to wave_write, but which were | |||||
| // never played | |||||
| // sun_audio_fd: used because some calls to wave_close seem to | |||||
| // pass a NULL for theHandler for some odd reason | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // The result of the ioctl call (non-0 means failure) | |||||
| // | |||||
| //<wave_close | |||||
| int wave_close(void* theHandler) | |||||
| { | |||||
| int ret; | |||||
| audio_info_t ainfo; | |||||
| int audio_fd = (int) theHandler; | |||||
| if (!audio_fd) { | |||||
| audio_fd = sun_audio_fd; | |||||
| } | |||||
| ENTER("wave_close"); | |||||
| // [[[WDW: maybe do a pause/resume ioctl???]]] | |||||
| ret = ioctl(audio_fd, I_FLUSH, FLUSHRW); | |||||
| ioctl(audio_fd, AUDIO_GETINFO, &ainfo); | |||||
| // Calculate the number of samples that won't get | |||||
| // played. We also keep track of the last_play_position | |||||
| // because wave_close can be called multiple times | |||||
| // before another call to wave_write. | |||||
| // | |||||
| if (last_play_position != ainfo.play.samples) { | |||||
| last_play_position = ainfo.play.samples; | |||||
| total_samples_skipped = total_samples_sent - last_play_position; | |||||
| } | |||||
| SHOW_TIME("wave_close > LEAVE"); | |||||
| return ret; | |||||
| } | |||||
| //> | |||||
| // wave_is_busy | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Returns a non-0 value if audio is being played. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // sun_audio_fd: used because some calls to wave_is_busy seem to | |||||
| // pass a NULL for theHandler for some odd reason | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // A non-0 value if audio is being played | |||||
| // | |||||
| //<wave_is_busy | |||||
| int wave_is_busy(void* theHandler) | |||||
| { | |||||
| audio_info_t ainfo; | |||||
| int audio_fd = (int) theHandler; | |||||
| if (!audio_fd) { | |||||
| audio_fd = sun_audio_fd; | |||||
| } | |||||
| ENTER("wave_is_busy"); | |||||
| ioctl(audio_fd, AUDIO_GETINFO, &ainfo); | |||||
| SHOW("wave_is_busy: active=%d", ainfo.play.active); | |||||
| SHOW_TIME("wave_is_busy > LEAVE"); | |||||
| return ainfo.play.active; | |||||
| } | |||||
| //> | |||||
| // wave_terminate | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Used to end our session with eSpeak. | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // sun_audio_fd: modified - closed and set to -1 | |||||
| // | |||||
| //<wave_terminate | |||||
| void wave_terminate() | |||||
| { | |||||
| ENTER("wave_terminate"); | |||||
| close(sun_audio_fd); | |||||
| sun_audio_fd = -1; | |||||
| SHOW_TIME("wave_terminate > LEAVE"); | |||||
| } | |||||
| //> | |||||
| // wave_flush | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Appears to want to tell the audio subsystem to make sure it plays | |||||
| // the audio. In our case, the system is already doing this, so this | |||||
| // is basically a no-op. [[[WDW - if you do a drain, you block, so | |||||
| // don't do that. In addition the typical SADA notion of flush is | |||||
| // currently handled by wave_close. I think this is most likely just | |||||
| // terminology conflict between eSpeak and SADA.]]] | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // | |||||
| //<wave_flush | |||||
| void wave_flush(void* theHandler) | |||||
| { | |||||
| ENTER("wave_flush"); | |||||
| //ioctl((int) theHandler, AUDIO_DRAIN, 0); | |||||
| SHOW_TIME("wave_flush > LEAVE"); | |||||
| } | |||||
| //> | |||||
| // wave_set_callback_is_output_enabled | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Sets the callback to call from wave_write before it sends data to | |||||
| // be played. It helps wave_write determine if the data should be | |||||
| // thrown away or not. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // cb: the callback to call from wave_write | |||||
| // | |||||
| //<wave_set_callback_is_output_enabled | |||||
| void wave_set_callback_is_output_enabled(t_wave_callback* cb) | |||||
| { | |||||
| my_callback_is_output_enabled = cb; | |||||
| } | |||||
| //> | |||||
| // wave_test_get_write_buffer | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Unnecessary and is used for debug output from | |||||
| // speak_lib.cpp:dispatch_audio. | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // NULL | |||||
| // | |||||
| //<wave_test_get_write_buffer | |||||
| void *wave_test_get_write_buffer() | |||||
| { | |||||
| return NULL; | |||||
| } | |||||
| //> | |||||
| // wave_get_read_position | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Concerns the sample which is currently played by the audio layer, | |||||
| // where 'sample' is a small buffer of synthesized wave data, | |||||
| // identified so that the user callback could be called when the | |||||
| // 'sample' is really played. The identifier is returned by | |||||
| // wave_get_write_position. This method is unused. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // The total number of 16-bit samples played by the audio system | |||||
| // so far. | |||||
| // | |||||
| //<wave_get_read_position | |||||
| uint32_t wave_get_read_position(void* theHandler) | |||||
| { | |||||
| audio_info_t ainfo; | |||||
| ENTER("wave_get_read_position"); | |||||
| ioctl((int) theHandler, AUDIO_GETINFO, &ainfo); | |||||
| SHOW("wave_get_read_position: %d\n", ainfo.play.samples); | |||||
| SHOW_TIME("wave_get_read_position > LEAVE"); | |||||
| return ainfo.play.samples; | |||||
| } | |||||
| //> | |||||
| // wave_get_write_position | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Returns an identifier for a new sample, where 'sample' is a small | |||||
| // buffer of synthesized wave data, identified so that the user | |||||
| // callback could be called when the 'sample' is really played. This | |||||
| // implementation views the audio as one long continuous stream of | |||||
| // 16-bit samples. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // theHandler: the audio device file descriptor | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // total_samples_sent: used as the return value | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // total_samples_sent, which is the index for the end of this long | |||||
| // continuous stream. [[[WDW: with a unit32_t managing 16-bit | |||||
| // samples at 22050Hz, we have about 54 hours of play time before | |||||
| // the index wraps back to 0. We don't handle that wrapping, so | |||||
| // the behavior after 54 hours of play time is undefined.]]] | |||||
| // | |||||
| //<wave_get_write_position | |||||
| uint32_t wave_get_write_position(void* theHandler) | |||||
| { | |||||
| ENTER("wave_get_write_position"); | |||||
| SHOW("wave_get_write_position: %d\n", total_samples_sent); | |||||
| SHOW_TIME("wave_get_write_position > LEAVE"); | |||||
| return total_samples_sent; | |||||
| } | |||||
| //> | |||||
| // wave_get_remaining_time | |||||
| // | |||||
| // DESCRIPTION: | |||||
| // | |||||
| // Returns the remaining time (in ms) before the sample is played. | |||||
| // The sample in this case is a return value from a previous call to | |||||
| // wave_get_write_position. | |||||
| // | |||||
| // PARAMETERS: | |||||
| // | |||||
| // sample: an index returned from wave_get_write_position representing | |||||
| // an index into the long continuous stream of 16-bit samples | |||||
| // time: a return value representing the delay in milliseconds until | |||||
| // sample is played. A value of 0 means the sample is either | |||||
| // currently being played or it has already been played. | |||||
| // | |||||
| // GLOBALS USED/MODIFIED: | |||||
| // | |||||
| // sun_audio_fd: used to determine total number of samples played by | |||||
| // the audio system | |||||
| // total_samples_skipped: used in remaining time calculation | |||||
| // | |||||
| // RETURNS: | |||||
| // | |||||
| // Time in milliseconds before the sample is played or 0 if the sample | |||||
| // is currently playing or has already been played. | |||||
| // | |||||
| //<wave_get_remaining_time | |||||
| int wave_get_remaining_time(uint32_t sample, uint32_t* time) | |||||
| { | |||||
| uint32_t a_time=0; | |||||
| uint32_t actual_index; | |||||
| audio_info_t ainfo; | |||||
| ENTER("wave_get_remaining_time"); | |||||
| if (!time) { | |||||
| return(-1); | |||||
| SHOW_TIME("wave_get_remaining_time > LEAVE"); | |||||
| } | |||||
| ioctl(sun_audio_fd, AUDIO_GETINFO, &ainfo); | |||||
| // See if this sample has already been played or is currently | |||||
| // playing. | |||||
| // | |||||
| actual_index = sample - total_samples_skipped; | |||||
| if ((sample < total_samples_skipped) || | |||||
| (actual_index <= ainfo.play.samples)) { | |||||
| *time = 0; | |||||
| } else { | |||||
| a_time = ((actual_index - ainfo.play.samples) * 1000) / SAMPLE_RATE; | |||||
| *time = (uint32_t) a_time; | |||||
| } | |||||
| SHOW("wave_get_remaining_time for %d: %d\n", sample, *time); | |||||
| SHOW_TIME("wave_get_remaining_time > LEAVE"); | |||||
| return 0; | |||||
| } | |||||
| #else | |||||
| // notdef USE_SADA | |||||
| void wave_init() {} | |||||
| void* wave_open(const char* the_api) {return (void *)1;} | |||||
| size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} | |||||
| int wave_close(void* theHandler) {return 0;} | |||||
| int wave_is_busy(void* theHandler) {return 0;} | |||||
| void wave_terminate() {} | |||||
| uint32_t wave_get_read_position(void* theHandler) {return 0;} | |||||
| uint32_t wave_get_write_position(void* theHandler) {return 0;} | |||||
| void wave_flush(void* theHandler) {} | |||||
| typedef int (t_wave_callback)(void); | |||||
| void wave_set_callback_is_output_enabled(t_wave_callback* cb) {} | |||||
| extern void* wave_test_get_write_buffer() {return NULL;} | |||||
| int wave_get_remaining_time(uint32_t sample, uint32_t* time) | |||||
| { | |||||
| if (!time) return(-1); | |||||
| *time = (uint32_t)0; | |||||
| return 0; | |||||
| } | |||||
| #endif // of USE_PORTAUDIO | |||||
| //> | |||||
| //<clock_gettime2, add_time_in_ms | |||||
| void clock_gettime2(struct timespec *ts) | |||||
| { | |||||
| struct timeval tv; | |||||
| if (!ts) | |||||
| { | |||||
| return; | |||||
| } | |||||
| assert (gettimeofday(&tv, NULL) != -1); | |||||
| ts->tv_sec = tv.tv_sec; | |||||
| ts->tv_nsec = tv.tv_usec*1000; | |||||
| } | |||||
| void add_time_in_ms(struct timespec *ts, int time_in_ms) | |||||
| { | |||||
| if (!ts) | |||||
| { | |||||
| return; | |||||
| } | |||||
| uint64_t t_ns = (uint64_t)ts->tv_nsec + 1000000 * (uint64_t)time_in_ms; | |||||
| while(t_ns >= ONE_BILLION) | |||||
| { | |||||
| SHOW("event > add_time_in_ms ns: %d sec %Lu nsec \n", ts->tv_sec, t_ns); | |||||
| ts->tv_sec += 1; | |||||
| t_ns -= ONE_BILLION; | |||||
| } | |||||
| ts->tv_nsec = (long int)t_ns; | |||||
| } | |||||
| #endif // USE_ASYNC | |||||
| //> |