espeakedit --compile also compiles the intonation data Added feature to produce phonemes as International Phonetic Alphabet. phoneme definitions: Added "ipa" instruction to specify IPA phoneme name. When spelling as individual characters, calculate the stress position for each character name. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@249 d46cf337-b52f-0410-862d-fd96e6ae7743master
i $u $brk // ??? | i $u $brk // ??? | ||||
// Conjunctions | // Conjunctions | ||||
a $u $pause // and | a $u $brk $pause // and | ||||
nebo $u $pause // or | nebo $u $pause // or | ||||
však $pause // but | však $pause // but | ||||
krom $pause // except | krom $pause // except |
| |||||
// This file is UTF8 encoded | // This file is UTF8 encoded | ||||
// Spelling-to-phoneme rules for Danish | // Spelling-to-phoneme rules for Danish | ||||
år) ede (_+ 3D@ // PB sårede | år) ede (_+ 3D@ // PB sårede | ||||
odr) ede (_+ 3D@ // PB fodrede | odr) ede (_+ 3D@ // PB fodrede | ||||
obr) ede (_ 3D@ // PB erobrede | obr) ede (_ 3D@ // PB erobrede | ||||
tr) ede (_+ 3D-@ // PB splintrede | tr) ede (_+ 3D@ // PB splintrede | ||||
hundr) ed (+ @:D // PB hundred | hundr) ed (+ @:D // PB hundred | ||||
rn) ed (e eD // PB dernede | rn) ed (e eD // PB dernede | ||||
&k) ede (+ eD@ // PB dødkede | &k) ede (+ eD@ // PB dødkede |
r) al (_ 'A:l | r) al (_ 'A:l | ||||
t) al (_ 'A:l | t) al (_ 'A:l | ||||
m) a (lt_ A:l | m) a (lt_ A:l | ||||
ker) am (ik 'A:m | |||||
@) an (_ 'A:n | @) an (_ 'A:n | ||||
ein) an (der 'an | ein) an (der 'an | ||||
@) ant (_ 'ant | @) ant (_ 'ant | ||||
_) farb (C@P4 f'arp | _) farb (C@P4 f'arp | ||||
_) farb (l@P4 f'arb | _) farb (l@P4 f'arb | ||||
_) fein (@P4 f'aIn | _) fein (@P4 f'aIn | ||||
_) fertig (CP6 f'ErtiC | |||||
_) fest (@P4 f'Est | _) fest (@P4 f'Est | ||||
_) flug fl'u:g | _) flug fl'u:g | ||||
foto fo:to: | foto fo:to: | ||||
i (d_ 'i: | i (d_ 'i: | ||||
i (dee %i: | i (dee %i: | ||||
i (erin =i: | i (erin =i: | ||||
ig (+ Ig# // [ig] or [iC] | &) ig (+ Ig# // [ig] or [iC] | ||||
igh aI | igh aI | ||||
i (i i:_! | i (i i:_! | ||||
// @) keit (_S4 kaIt | // @) keit (_S4 kaIt | ||||
// @) keiten (_S6 kaIt@n | // @) keiten (_S6 kaIt@n | ||||
ka (rtoff k%a | |||||
ko (e@ ko: | ko (e@ ko: | ||||
kolleg k%Ole:g | kolleg k%Ole:g | ||||
_) komme (C@ k%OmE | _) komme (C@ k%OmE | ||||
o (lsam o: | o (lsam o: | ||||
o (m_ 'o: | o (m_ 'o: | ||||
@A) o (n_ 'o: | @A) o (n_ 'o: | ||||
one (_ 'o:n@ | |||||
onen (_ 'o:n@n | |||||
zitr) on 'on | |||||
@) oo (_ u: | @) oo (_ u: | ||||
r) oo (m u: | r) oo (m u: | ||||
z) oo (m u: | z) oo (m u: | ||||
pool _^_EN | pool _^_EN | ||||
power paU@r | power paU@r | ||||
_) preß (@P4 pr'Es | _) preß (@P4 pr'Es | ||||
_) primär (P6 pri:m'E:r | |||||
_) prinzipien (@P9 prInts'i:pI@ | _) prinzipien (@P9 prInts'i:pI@ | ||||
_) privat (@P6 pri:v'A:t | _) privat (@P6 pri:v'A:t | ||||
problem pr%o:ble:m | problem pr%o:ble:m |
Dictionary de_dict | Dictionary de_dict | ||||
3 3: @ @- a A A: aI | 3 3: @ @- a A A: aI | ||||
aU E E2 E: e: EI I i2 | aU E E2 E: e: EI i I | ||||
i: n- O o: OY U u: W | i2 i: n- o O o: OY U | ||||
y y: Y: | u: W y y: Y: | ||||
* : ; b C d D dZ | * : ; b C d D dZ | ||||
f g g# h j k l m | f g g# h j k l m | ||||
; C f h j k kh l | ; C f h j k kh l | ||||
l# m n N p ph Q q | l# m n N p ph Q q | ||||
Q" Q^ r R r" R2 R3 s | Q" Q^ r R R2 R3 s s. | ||||
s. S; t th ts ts. ts. tS; | S; t th ts ts. ts. tS; tS; | ||||
tS; tsh v w x X z. | tsh v w x X z. | ||||
Dictionary zhy_dict | Dictionary zhy_dict | ||||
h j J k l l# m n | h j J k l l# m n | ||||
N n^ p Q r R R3 s | N n^ p Q r R R3 s | ||||
S t T tS v w x z | S t T tS v w x z | ||||
Dictionary ht_dict | |||||
a A~ e E E~ i o O | |||||
O~ u w y | |||||
; b d f g j k l | |||||
m n N p r s S t | |||||
tS v z Z |
?5 workstation w'VRkst,eIS@n | ?5 workstation w'VRkst,eIS@n | ||||
wound wu:nd | wound wu:nd | ||||
wound waUnd $past | wound waUnd $past | ||||
(wound down) w,aUnd||'daUn | |||||
(wound up) w,aUnd||'Vp | (wound up) w,aUnd||'Vp | ||||
wounded wu:ndI2d | wounded wu:ndI2d | ||||
wretched rEtSI2d | wretched rEtSI2d | ||||
Taiwan taI'wan | Taiwan taI'wan | ||||
(tel aviv) t,El||a#v'i:v | (tel aviv) t,El||a#v'i:v | ||||
Tenerife tEn3r'i:f | Tenerife tEn3r'i:f | ||||
Texas tEks@s | |||||
Toronto t@r0ntoU | Toronto t@r0ntoU | ||||
Timor ti:mo@ | Timor ti:mo@ | ||||
Tokyo toUkIoU | Tokyo toUkIoU | ||||
whilst w,aIlst $pause | whilst w,aIlst $pause | ||||
(do so) du:||soU $atend | |||||
//some adverbs | //some adverbs | ||||
just $verbf | just $verbf | ||||
never $verbf | never $verbf |
// 2006-11-18 Gilles Casse <gcasse@oralux.org> | // 2006-11-18 Gilles Casse <gcasse@oralux.org> | ||||
// | // | ||||
// Updated 2010-06-15 Michel Such <michel.such@free.fr> | // Updated 2010-06-22 Michel Such <michel.such@free.fr> | ||||
// | // | ||||
// * Numbers, a few abbreviations and exceptions. | // * Numbers, a few abbreviations and exceptions. | ||||
// | // | ||||
delete _^_en | delete _^_en | ||||
dernier dErnjer2 | dernier dErnjer2 | ||||
doppler doplEr | doppler doplEr | ||||
dot dOt | |||||
éloquent elokA~t2 | éloquent elokA~t2 | ||||
enfer A~fEr | enfer A~fEr | ||||
fahrenheit far@najt | fahrenheit far@najt |
// 2006-11-18 Gilles Casse <gcasse@oralux.org> | // 2006-11-18 Gilles Casse <gcasse@oralux.org> | ||||
// | // | ||||
// Updated: 2010-06-18 Michel Such <michel.such@free.fr> | // Updated: 2010-06-29 Michel Such <michel.such@free.fr> | ||||
// | // | ||||
// Letter classes: | // Letter classes: | ||||
an (n_ a | an (n_ a | ||||
_h) an (_ an | _h) an (_ an | ||||
_) anti (@@P4 A~ti | _) anti (@@P4 A~ti | ||||
_) anti (CAXP4 A~ti | |||||
_) arché (@P5 arke // archéologue | _) arché (@P5 arke // archéologue | ||||
_) archéo (@P6 arkeo // archéologue | _) archéo (@P6 arkeo // archéologue | ||||
_) arch (aP4 ark // archange | _) arch (aP4 ark // archange | ||||
ss s // assez | ss s // assez | ||||
ai) s (em s // vraisemblable | ai) s (em s // vraisemblable | ||||
_al) s (ac z // Alsace | |||||
aCè) s (_ s | aCè) s (_ s | ||||
nè) s (_ s | nè) s (_ s | ||||
kansa) s (_ s // Kansas, Arkansas | kansa) s (_ s // Kansas, Arkansas |
nyit $unstressend | nyit $unstressend | ||||
lő $unstressend | lő $unstressend | ||||
támad $unstressend | támad $unstressend | ||||
halt $unstressend | |||||
ész $unstressend | |||||
kapta $unstressend | |||||
kaptak $unstressend | |||||
// word pairs | // word pairs | ||||
honvé) d (sereg d | honvé) d (sereg d | ||||
va) d (szeder d | va) d (szeder d | ||||
twee) d (sapk d | twee) d (sapk d | ||||
fe) dd (hetetlen d | |||||
.group dz | .group dz | ||||
fogó) dz (kod ts | fogó) dz (kod ts | ||||
_e) gy (oldal J: | _e) gy (oldal J: | ||||
_e) gy (év J: | _e) gy (év J: | ||||
_e) gy (órá J: | _e) gy (órá J: | ||||
_e) gy (se J | |||||
.group h | .group h | ||||
h h | h h | ||||
sz) í (ve i | sz) í (ve i | ||||
t) í (zes i | t) í (zes i | ||||
sz) í (vel i: | sz) í (vel i: | ||||
_t) í (zük i | |||||
.group j | .group j | ||||
j j | j j | ||||
teljesítmé) ny (javu n^ | teljesítmé) ny (javu n^ | ||||
törvé) ny (java n^ | törvé) ny (java n^ | ||||
ajá) nl l: | ajá) nl l: | ||||
_feddhetetle) n (jelle n | |||||
állomá) ny (jel n^ | |||||
.group o | .group o | ||||
o o | o o |
_18 'Axtin | _18 'Axtin | ||||
_19 n'e:x@ntin | _19 n'e:x@ntin | ||||
_2X tv#'Int@x | _2X tv#'Int@x | ||||
_3X d'e:rt@x | _3X d'Ert@x | ||||
_4X f'e:rt@x | _4X f'e:rt@x | ||||
_5X f'EIft@x | _5X f'EIft@x | ||||
_6X z'Est@x | _6X z'Est@x | ||||
waar $pause | waar $pause | ||||
// prepositions | // prepositions | ||||
in $u+ $brk // in | in $only $u+ $brk // in | ||||
op $u+ $brk // in | op $only $u+ $brk // in | ||||
aan $u+ $brk // at, on | aan $only $u+ $brk // at, on | ||||
bij $u+ $pause // at, near | bij $only $u+ $pause // at, near | ||||
om $u+ $brk // at | om $only $u+ $brk // at | ||||
met $u+ $brk // with, by | met $only $u+ $brk // with, by | ||||
over $u+ $pause // about | over $only $u+ $pause // about | ||||
na $u+ $pause // after | na $only $u+ $pause // after | ||||
naar $u+ // to | naar $only $u+ // to | ||||
door $u+ $brk // through, by | door $only $u+ $brk // through, by | ||||
te $u+ $brk // to | te $only $u+ $brk // to | ||||
tot $u+ $pause // until | tot $only $u+ $pause // until | ||||
uit $u+ $brk // from, out of | uit $only $u+ $brk // from, out of | ||||
voor $u+ $pause // for, in front of | voor $only $u+ $pause // for, in front of | ||||
van $u+ // from, of | van $only $u+ // from, of | ||||
zonder $u+ $pause // without | zonder $only $u+ $pause // without | ||||
// adverbs, etc. | // adverbs, etc. | ||||
ook $u+ // any | ook $only $u+ // any | ||||
zo $u+ | zo $only $u+ | ||||
sommige $u+ // some | sommige $only $u+ // some | ||||
// conjunctions | // conjunctions | ||||
up _^_EN | up _^_EN | ||||
// words where -eren is not a verb ending | // words where -eren is not a stressed verb ending | ||||
ander $alt | ander $alt | ||||
kinder $alt | kinder $alt | ||||
ouder $alt | ouder $alt | ||||
sputter $alt | |||||
// pronunciation exceptions | // pronunciation exceptions | ||||
aangrijpend $2 | aangrijpend $2 | ||||
ingrediënt $4 | ingrediënt $4 | ||||
ingenieur Inzj@nj'Y:r | ingenieur Inzj@nj'Y:r | ||||
journaal Surn'a:l | journaal Surn'a:l | ||||
natuur na:t'yr | |||||
ongastvrij OnQAstv@-*'EI | ongastvrij OnQAstv@-*'EI | ||||
ongelooflijk $3 | ongelooflijk $3 | ||||
ongemakkelijk $3 | ongemakkelijk $3 | ||||
ongrondwettig $3 | ongrondwettig $3 | ||||
proces $2 | proces $2 | ||||
renaissance rEne:s'A~s@ | renaissance rEne:s'A~s@ | ||||
tegenaan $3 | |||||
tegenin $3 | |||||
tegenover $3 | |||||
tegendraads $3 | |||||
tegennatuur $4 | |||||
tegenstrijdig $3 | |||||
tegenwoordig $3 | |||||
waarschijnlijk $2 | waarschijnlijk $2 | ||||
_) be (ren bI: | _) be (ren bI: | ||||
_) be (ter be: | _) be (ter be: | ||||
_) beu bY: | _) beu bY: | ||||
&) baar (_ =ba:r | |||||
.group c | .group c | ||||
.group g | .group g | ||||
g Q // ph_dutch changes this to [x] before unvoiced | g Q // ph_dutch changes to [x] before unvoiced, NULL after [x] | ||||
gg Q | gg Q | ||||
_) ge (@P2 Q@ | _) ge (@P2 Q@ | ||||
ie i | ie i | ||||
ieuw iw | ieuw iw | ||||
d) ie (_ 'i | |||||
g) ie (_ 'i | |||||
m) ie (_ 'i | |||||
p) ie (_ 'i | |||||
ie (r_ 'i | |||||
ie (rd_ 'i | ie (rd_ 'i | ||||
@) ig (_ @x | @) ig (_ @x | ||||
_) in (gP2 'In | _) in (gP2 'In | ||||
@) isch (_ =is | |||||
@) ische (_ =is@ | |||||
.group j | .group j | ||||
ll l | ll l | ||||
@) lijk (_S4 l@k | @) lijk (_S4 l@k | ||||
&) laan (_S4 la:n | &) laan (_S4 la:n | ||||
@) loog (_ lo:x | |||||
.group m | .group m | ||||
oei uj | oei uj | ||||
ou VU | ou VU | ||||
telef) oo (n 'o: | |||||
.group on | |||||
_) onaan (@P5 On'a:n | _) onaan (@P5 On'a:n | ||||
_) onge (@P4 ,OnQ@ | _) onge (@P4 ,OnQ@ | ||||
_) ont (@P3 Ont | _) ont (@P3 Ont | ||||
_) on (te@P2 On // ontegecht | |||||
_) onder Ond@r | _) onder Ond@r | ||||
_) ong (aarn ,OnQ' | _) ong (aarn ,OnQ' | ||||
c) tie (_ si | c) tie (_ si | ||||
tj t; | tj t; | ||||
tsj tS | tsj tS | ||||
_) th t | |||||
th t | |||||
t (haar t // th is not [t] | |||||
t (hav t | |||||
.group te | |||||
_) tegen (P5 t'e:Q@n | |||||
_) terug (P5 t@r'8x | |||||
_) te (gelijk t@ | |||||
_) te (gemoetP2 t@ | |||||
_) te (goed t@ | |||||
_) te (hui t@ // tehuis | |||||
_) te (keer t@ | |||||
_) te (kort t@ | |||||
_) te (leur t@ | |||||
_) te (loor t@ | |||||
_) te (meer t@ | |||||
_) te (midd t@ // temidden | |||||
_) te (na t@ | |||||
_) te (neer t@ | |||||
_) te (recht t@ | |||||
_) te (sam t@ // tesamen | |||||
_) te (veel t@ | |||||
_) te (vergreefP2 t@ | |||||
_) te (voorschijn t@ | |||||
_) te (vor t@ // tevoren | |||||
_) te (vred t@ // tevreden | |||||
_) teweeg (P6 t@v#'e:x | |||||
.group u | .group u |
ஆகா a:Ha: | ஆகா a:Ha: | ||||
ஓகோ o:Ho: | ஓகோ o:Ho: | ||||
கப் kVp | கப் kVp | ||||
செட் set. |
//sort | //sort | ||||
அலை) க (டல kV | அலை) க (டல kV | ||||
சமையல்) க (ட் kV | |||||
_கல்) க (ண்ட kV | _கல்) க (ண்ட kV | ||||
_நற்) க (தி gV | _நற்) க (தி gV | ||||
வீண்) க (தை kV | வீண்) க (தை kV | ||||
க (ுல k | க (ுல k | ||||
_அங்) க (ுல g | _அங்) க (ுல g | ||||
_) குல்க (ந்த gulkV | _) குல்க (ந்த gulkV | ||||
நீல) க (ேசி k | |||||
புலி) க (ேசி k | |||||
குண்டல) க (ேசி k | குண்டல) க (ேசி k | ||||
ம) க (ேசுவர H // need to restrict to _ம) and _வீரம) ?? | ம) க (ேசுவர H // need to restrict to _ம) and _வீரம) ?? | ||||
சீர்) க (ேட k | |||||
ம) க (ேந்திர H | ம) க (ேந்திர H | ||||
ம) க (ேஷ்வ H | ம) க (ேஷ்வ H | ||||
ம) க (ேஸ்வர H | ம) க (ேஸ்வர H | ||||
ஆரோ) க்க (ிய gg | ஆரோ) க்க (ிய gg | ||||
வைரா) க்க (ிய gg | வைரா) க்க (ிய gg | ||||
_வி) க்க (ிரக gg | _வி) க்க (ிரக gg | ||||
கு) க்கி (ராம gg | |||||
ஜன) க்க (ும்பல gg | ஜன) க்க (ும்பல gg | ||||
வி) க்ட (ோரியா kt. // victoria | வி) க்ட (ோரியா kt. // victoria | ||||
வி) க (்ரம k | வி) க (்ரம k | ||||
_) ட (வர t.V | _) ட (வர t.V | ||||
_) ட (ேப t. | _) ட (ேப t. | ||||
_) டாக (்ஸி t.a:k | _) டாக (்ஸி t.a:k | ||||
_ல) ட்ட d.d.V# | |||||
.group ண | .group ண | ||||
ண n.V | ண n.V | ||||
_) த (ுச்சம d | _) த (ுச்சம d | ||||
_) த (ுச்சாதனன d | _) த (ுச்சாதனன d | ||||
_) த (ுட்ட d | _) த (ுட்ட d | ||||
_) த (ுபாய d | |||||
_) த (ுரதிர்ஷ்ட d | _) த (ுரதிர்ஷ்ட d | ||||
_) த (ுராசை d | _) த (ுராசை d | ||||
_) த (ுரியோதனன d | _) த (ுரியோதனன d | ||||
_) த (ொம் d | _) த (ொம் d | ||||
_) த (ோசை d | _) த (ோசை d | ||||
_) த (ோஷ d | _) த (ோஷ d | ||||
_) த (ுபாய d | |||||
//endsort | //endsort | ||||
//sort | //sort | ||||
_வசந்) த tV# | _வசந்) த tV# | ||||
_ப) த (ஞ்சலி tV | |||||
_கீழ்) த (ட்ட tV | _கீழ்) த (ட்ட tV | ||||
_மேல்) த (ட்ட tV | _மேல்) த (ட்ட tV | ||||
முட்டாள்) த (ன tV | முட்டாள்) த (ன tV | ||||
ச) த (்ரு t | ச) த (்ரு t | ||||
த) த (்ரூப t | த) த (்ரூப t | ||||
பா) த (்ரூம t | பா) த (்ரூம t | ||||
_ப) த (ஞ்சலி tV | |||||
//endsort | //endsort | ||||
_) ப (ிக்கு b | _) ப (ிக்கு b | ||||
_) ப (ிக்ஷு b | _) ப (ிக்ஷு b | ||||
_) ப (ிக்ஷூ b | _) ப (ிக்ஷூ b | ||||
_) ப (ிம்ப b | |||||
_) ப (ிரகதீ b | _) ப (ிரகதீ b | ||||
_) ப (ிரகஸ்பதி b | _) ப (ிரகஸ்பதி b | ||||
_) ப (ிரம்ம b | _) ப (ிரம்ம b | ||||
சீதா) பதி pVti | சீதா) பதி pVti | ||||
சேது) பதி pVti | சேது) பதி pVti | ||||
தரணி) பதி pVti | தரணி) பதி pVti | ||||
திரௌ) ப (தி pV | |||||
பிரஜா) பத (ி pVt | பிரஜா) பத (ி pVt | ||||
மகுட) பதி pVti | மகுட) பதி pVti | ||||
பிரகஸ்) பதி pVti | பிரகஸ்) பதி pVti | ||||
அனு) ப (மா pV | அனு) ப (மா pV | ||||
_க) ப (ம்_ bV | _க) ப (ம்_ bV | ||||
_ஊடு) ப (யிர pV | _ஊடு) ப (யிர pV | ||||
நாகா) ப (ரண bV | |||||
கரம்) ப (ற் pV | கரம்) ப (ற் pV | ||||
ப (ற்றி_ pV | ப (ற்றி_ pV | ||||
பல) ப (ல pV | பல) ப (ல pV | ||||
அடி) ப (ாவி p | அடி) ப (ாவி p | ||||
கோ) ப (ி p | கோ) ப (ி p | ||||
_முன்) ப (ின்_ p | _முன்) ப (ின்_ p | ||||
_) ப (ிப்ரவரி f | |||||
உடன்) ப (ிற p | உடன்) ப (ிற p | ||||
ப (ிறகு+ p | ப (ிறகு+ p | ||||
தேய்) ப (ிறை p | |||||
வளர்) ப (ிறை p | |||||
சிறு) ப (ிள்ளை p | சிறு) ப (ிள்ளை p | ||||
ஆண்) ப (ிள்ளை p | ஆண்) ப (ிள்ளை p | ||||
பெண்) ப (ிள்ளை p | பெண்) ப (ிள்ளை p | ||||
_) பி (ரே p | _) பி (ரே p | ||||
_) பி (ரோகிதர p | _) பி (ரோகிதர p | ||||
_) பி (ளாட்பார p | _) பி (ளாட்பார p | ||||
_) பி (ளாஸ்க் f | _) பி (ளாஸ்க் f // flask | ||||
_) பீ (ராமண b | _) பீ (ராமண b | ||||
அதிக) ப்பி (ரசங்க pp | அதிக) ப்பி (ரசங்க pp | ||||
_பர) ப்பி (ரம்ம pb | |||||
//endsort | //endsort | ||||
// musical notes | // musical notes | ||||
// vowel letters | // vowel letters | ||||
.group 0xe0ae // characters which start with UTF-8 bytes: [e0 ae] | .group இ | ||||
//sort | |||||
ஂ // anusvara | |||||
அ a | |||||
ஆ a: | |||||
இ i | இ i | ||||
_) இ (லட்சிய // silent | |||||
_) இ (ரகசிய // silent | _) இ (ரகசிய // silent | ||||
_) இ (லேச // silent | _) இ (ரசாயன | ||||
_) இ (ரத்த | _) இ (ரத்த | ||||
_) இ (ராம | |||||
_) இ (ராவண | |||||
_) இ (ராத்த | |||||
_) இ (ராஜ | _) இ (ராஜ | ||||
_) இ (ராணி | |||||
_) இ (ராணுவ | _) இ (ராணுவ | ||||
_) இ (ராத்த | |||||
_) இ (ராம | |||||
_) இ (ராவண | |||||
_) இ (லகுவாக | _) இ (லகுவாக | ||||
_) இ (ராணி | |||||
_) இ (லட்சண | _) இ (லட்சண | ||||
_) இ (லட்சிய // silent | |||||
_) இ (லவங்க | |||||
_) இ (லேச // silent | |||||
//endsort | |||||
.group 0xe0ae // characters which start with UTF-8 bytes: [e0 ae] | |||||
ஂ // anusvara | |||||
அ a | |||||
ஆ a: | |||||
ஈ i: | ஈ i: | ||||
எ e | எ e | ||||
_) எ ;e // add a short [j] sound at start of word ? | _) எ ;e // add a short [j] sound at start of word ? | ||||
எப (்ரல ;e:p | |||||
ஏ e: | ஏ e: | ||||
_) ஏ ;e: // add a short [j] sound at start of word ? | _) ஏ ;e: // add a short [j] sound at start of word ? |
63 phoneme tables | 64 phoneme tables | ||||
new total | new total | ||||
base 107 107 | base 107 107 | ||||
consonants 9 115 | consonants 9 115 | ||||
fr 56 138 | fr 56 138 | ||||
fr-ca 11 138 | fr-ca 11 138 | ||||
hi 58 149 | hi 58 149 | ||||
ta 21 152 | ta 20 151 | ||||
hu 24 121 | hu 24 121 | ||||
lv 29 125 | lv 29 125 | ||||
nl 24 125 | nl 24 125 | ||||
gd 6 107 | gd 6 107 | ||||
bg 10 119 | bg 10 119 | ||||
nso 8 107 | nso 8 107 | ||||
ht 11 138 | |||||
Data file Used by | Data file Used by | ||||
b/b [b] base | b/b [b] base | ||||
[l/] fr | [l/] fr | ||||
l/l_@ [l/3] base | l/l_@ [l/3] base | ||||
[l/] fr | [l/] fr | ||||
l/l@ [l#] base | l/l@ [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/L1_aL [l/] base | l/L1_aL [l/] base | ||||
l/L2_uL [l/2] base | l/L2_uL [l/2] base | ||||
l/l_3 [l/] de | l/l_3 [l/] de | ||||
l/l_4 [ll] sq | l/l_4 [ll] sq | ||||
l/la [l#] base | l/la [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/l_a [l/3] base | l/l_a [l/3] base | ||||
[l/] fr | [l/] fr | ||||
l/le [l#] base | l/le [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/l_e [l/3] base | l/l_e [l/3] base | ||||
[&:] af | [&:] af | ||||
l/l_front [L] sq | l/l_front [L] sq | ||||
l/l_front_ [l/4] sq | l/l_front_ [l/4] sq | ||||
l/li [l#] base | l/li [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
[l] zh | [l] zh | ||||
ll/_ll [L] bg | ll/_ll [L] bg | ||||
l/l_long [l] base | l/l_long [l] base | ||||
[l] fr | [l] fr | ||||
l/lo [l#] base | l/lo [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/l_o [l/3] base | l/l_o [l/3] base | ||||
[l/] fr | [l/] fr | ||||
l^/l_rfx [l.] base | l^/l_rfx [l.] base | ||||
l/lu [l#] base | l/lu [á3m] base | ||||
[߸] base | [l#] base | ||||
[l] fr | [l] fr | ||||
[l/2] fr | [l/2] fr | ||||
l/l_u [l/3] base | l/l_u [l/3] base | ||||
vnasal/aa_n2 [A~] en | vnasal/aa_n2 [A~] en | ||||
vnasal/aa_n3 [A~] af | vnasal/aa_n3 [A~] af | ||||
vnasal/aa_n4 [A~] fr | vnasal/aa_n4 [A~] fr | ||||
[A~] ht | |||||
vnasal/a#_n [&~] pt | vnasal/a#_n [&~] pt | ||||
vnasal/a#u_n [&U~] pt | vnasal/a#u_n [&U~] pt | ||||
[&U~] pt-pt | [&U~] pt-pt | ||||
vnasal/oi_n [oI~] pt | vnasal/oi_n [oI~] pt | ||||
vnasal/o_n [o~] hi | vnasal/o_n [o~] hi | ||||
[o~] pt | [o~] pt | ||||
[O~] ht | |||||
vnasal/o_n2 [o~] af | vnasal/o_n2 [o~] af | ||||
[O~] fr | [O~] fr | ||||
vnasal/oo_n2 [O~] en | vnasal/oo_n2 [O~] en | ||||
vnasal/V_n [V~] hi | vnasal/V_n [V~] hi | ||||
vnasal/W_n [E~] fr | vnasal/W_n [E~] fr | ||||
[W~] fr | [W~] fr | ||||
[E~] ht | |||||
voc/bh [B] base | voc/bh [B] base | ||||
voc/dh [D] base | voc/dh [D] base | ||||
voc/dh_ [D] base | voc/dh_ [D] base | ||||
voc/z_pzd_ [Z;] base | voc/z_pzd_ [Z;] base | ||||
[z;] base | [z;] base | ||||
vowel/@ [@] base | vowel/@ [@] base | ||||
[3] en | |||||
[@] en | [@] en | ||||
[@2] en | [@2] en | ||||
[@5] en | [@5] en | ||||
[@] de | [@] de | ||||
[@] nl | [@] nl | ||||
[@] no | [@] no | ||||
vowel/@_6 [3] en | vowel/@_6 [@] en | ||||
[@] en | |||||
[W] fr | [W] fr | ||||
vowel/8 [o-] zh | vowel/8 [o-] zh | ||||
vowel/8_2 [U] en-us | vowel/8_2 [U] en-us | ||||
[a:] vi | [a:] vi | ||||
vowel/a_7 [a] en | vowel/a_7 [a] en | ||||
[a] fr | [a] fr | ||||
[a] ht | |||||
vowel/aa [A] fr-ca | vowel/aa [A] fr-ca | ||||
[A] no | [A] no | ||||
[A:] no | [A:] no | ||||
[e:] hu | [e:] hu | ||||
[e] ku | [e] ku | ||||
vowel/e_5 [i] en-sc | vowel/e_5 [i] en-sc | ||||
vowel/e_8 [e] fr | vowel/e_6 [e] ht | ||||
vowel/e_8 [E:] de | |||||
[e] fr | |||||
vowel/e_9 [E2] fr | vowel/e_9 [E2] fr | ||||
vowel/ee [E] en-n | vowel/ee [E] en-n | ||||
[E] sv | [E] sv | ||||
[e] hy | [e] hy | ||||
[E] prs | [E] prs | ||||
[e] bg | [e] bg | ||||
[E] ht | |||||
vowel/e_mid2 [E] af | vowel/e_mid2 [E] af | ||||
[E] de | [E] de | ||||
[E2] de | [E2] de | ||||
[E:] de | |||||
[e] jbo | [e] jbo | ||||
[e] nci | [e] nci | ||||
[e] fi | [e] fi | ||||
[i] sq | [i] sq | ||||
vowel/i#_7 [i[] zh | vowel/i#_7 [i[] zh | ||||
vowel/i_8 [i] fr | vowel/i_8 [i] fr | ||||
[i] ht | |||||
vowel/i_en [i:] en | vowel/i_en [i:] en | ||||
[i:] en-us | [i:] en-us | ||||
vowel/i_fnt [i:] en-wi | vowel/i_fnt [i:] en-wi | ||||
vowel/o_7 [o] ku | vowel/o_7 [o] ku | ||||
vowel/o_8 [o] fr | vowel/o_8 [o] fr | ||||
[o2] fr | [o2] fr | ||||
[o] ht | |||||
vowel/oe [W] af | vowel/oe [W] af | ||||
[W] de | [W] de | ||||
[W] hy | [W] hy | ||||
[o] bg | [o] bg | ||||
vowel/o_mid2 [O] fr | vowel/o_mid2 [O] fr | ||||
[o] fr | [o] fr | ||||
[O] ht | |||||
vowel/oo [o] base | vowel/oo [o] base | ||||
[O:] en-sc | [O:] en-sc | ||||
[O] en-wi | [O] en-wi | ||||
[u] is | [u] is | ||||
[u] tr | [u] tr | ||||
[u] bg | [u] bg | ||||
vowel/u#_2 [u-] ta | vowel/u#_2 [u-] sv | ||||
[u-] sv | |||||
vowel/u#_3 [U] ta | vowel/u#_3 [U] ta | ||||
[U:] ta | [U:] ta | ||||
vowel/u#_4 [U] en-sc | vowel/u#_4 [U] en-sc | ||||
[u] bg | [u] bg | ||||
vowel/u_bck2 [u] fr | vowel/u_bck2 [u] fr | ||||
[u:] fr | [u:] fr | ||||
[u] ta | |||||
[u:] ta | |||||
[u:] la | [u:] la | ||||
[u] ht | |||||
vowel/uu [U] en | vowel/uu [U] en | ||||
[U] en-n | [U] en-n | ||||
[U] en-wm | [U] en-wm | ||||
vwl_en_us/ee [E] en-us | vwl_en_us/ee [E] en-us | ||||
vwl_en_us/er [e@] en-us | vwl_en_us/er [e@] en-us | ||||
vwl_en_us/ir [i@3] en-us | vwl_en_us/ir [i@3] en-us | ||||
vwl_en_us/oor [0] en-us | vwl_en_us/oor [O:] en-us | ||||
[O:] en-us | |||||
[O@] en-us | [O@] en-us | ||||
vwl_en_us/or [o@] en-us | vwl_en_us/or [o@] en-us | ||||
[O:] en-sc | [O:] en-sc | ||||
vwl_en_us/ur [U@] en-us | vwl_en_us/ur [U@] en-us | ||||
vwl_fr/@2r [߸] fr | vwl_fr/@2r [�æ] fr | ||||
vwl_fr/a2r [߸] fr | vwl_fr/a2r [�æ] fr | ||||
vwl_fr/aa2r [߸] fr | vwl_fr/aa2r [�æ] fr | ||||
vwl_fr/br [r/2] fr | vwl_fr/br [r/2] fr | ||||
vwl_fr/e2r [߸] fr | vwl_fr/e2r [�æ] fr | ||||
vwl_fr/e_2r [߸] fr | vwl_fr/e_2r [�æ] fr | ||||
vwl_fr/ee2r [߸] fr | vwl_fr/ee2r [�æ] fr | ||||
vwl_fr/i2r [߸] fr | vwl_fr/i2r [�æ] fr | ||||
vwl_fr/j [j/] fr | vwl_fr/j [j/] fr | ||||
vwl_fr/o2r [߸] fr | vwl_fr/o2r [�æ] fr | ||||
vwl_fr/oo2r [߸] fr | vwl_fr/oo2r [�æ] fr | ||||
vwl_fr/r [r] fr | vwl_fr/r [r] fr | ||||
[r/2] fr | [r/2] fr | ||||
vwl_fr/r_ [r/] fr | vwl_fr/r_ [r/] fr | ||||
vwl_fr/r_@ [r/] fr | vwl_fr/r_@ [r/] fr | ||||
vwl_fr/r@ [߸] fr | vwl_fr/r@ [�æ] fr | ||||
vwl_fr/@R [x] pt-pt | vwl_fr/@R [x] pt-pt | ||||
vwl_fr/r@2 [߸] fr | vwl_fr/r@2 [�æ] fr | ||||
vwl_fr/@R2 [R] fr-ca | vwl_fr/@R2 [R] fr-ca | ||||
vwl_fr/ra [߸] fr | vwl_fr/ra [�æ] fr | ||||
vwl_fr/r_a [r/] fr | vwl_fr/r_a [r/] fr | ||||
vwl_fr/raa [߸] fr | vwl_fr/raa [�æ] fr | ||||
vwl_fr/re [߸] fr | vwl_fr/re [�æ] fr | ||||
vwl_fr/r_e [r/] fr | vwl_fr/r_e [r/] fr | ||||
vwl_fr/re2 [߸] fr | vwl_fr/re2 [�æ] fr | ||||
vwl_fr/ree [߸] fr | vwl_fr/ree [�æ] fr | ||||
vwl_fr/ri [߸] fr | vwl_fr/ri [�æ] fr | ||||
vwl_fr/r_i [r/] fr | vwl_fr/r_i [r/] fr | ||||
vwl_fr/rj [߸] fr | vwl_fr/rj [�æ] fr | ||||
vwl_fr/r_n [r/] fr | vwl_fr/r_n [r/] fr | ||||
vwl_fr/ro [߸] fr | vwl_fr/ro [�æ] fr | ||||
vwl_fr/r_o [r/] fr | vwl_fr/r_o [r/] fr | ||||
vwl_fr/roo [߸] fr | vwl_fr/roo [�æ] fr | ||||
vwl_fr/rr [r/] fr | vwl_fr/rr [r/] fr | ||||
vwl_fr/ru [߸] fr | vwl_fr/ru [�æ] fr | ||||
vwl_fr/r_u [r/] fr | vwl_fr/r_u [r/] fr | ||||
vwl_fr/rw [߸] fr | vwl_fr/rw [�æ] fr | ||||
vwl_fr/ry [߸] fr | vwl_fr/ry [�æ] fr | ||||
vwl_fr/r_y [r/] fr | vwl_fr/r_y [r/] fr | ||||
vwl_fr/tr [r/2] fr | vwl_fr/tr [r/2] fr | ||||
vwl_fr/trr [r/] fr | vwl_fr/trr [r/] fr | ||||
vwl_fr/u2r [߸] fr | vwl_fr/u2r [�æ] fr | ||||
vwl_fr/wa [w] fr | vwl_fr/wa [w] fr | ||||
[w/] fr | [w/] fr | ||||
vwl_fr/y2r [߸] fr | vwl_fr/y2r [�æ] fr | ||||
vwl_hi/l-voc [l-] base | vwl_hi/l-voc [l-] base | ||||
[l-] sk | [l-] sk | ||||
[l:] sk | [l:] sk |
phoneme r* | phoneme r* | ||||
vowel nonsyllabic | vowel nonsyllabic | ||||
unstressed | unstressed | ||||
ipa r | |||||
length 50 | length 50 | ||||
starttype #@ endtype #@ | starttype #@ endtype #@ | ||||
AppendPhoneme(*) | AppendPhoneme(*) |
phoneme R | phoneme R | ||||
lengthmod 7 | lengthmod 7 | ||||
liquid | liquid | ||||
ipa ʁ | |||||
FMT(r/aa) | FMT(r/aa) | ||||
endphoneme | endphoneme | ||||
Vowelin f1=2 f2=2300 200 300 f3=-300 80 | Vowelin f1=2 f2=2300 200 300 f3=-300 80 | ||||
Vowelout f1=2 f2=2300 250 300 f3=-300 80 brk | Vowelout f1=2 f2=2300 250 300 f3=-300 80 brk | ||||
IF prevPhW(x) THEN | |||||
ChangePhoneme(NULL) | |||||
ENDIF | |||||
IF nextPhW(isVoiced) THEN | IF nextPhW(isVoiced) THEN | ||||
ELSE | ELSE | ||||
ChangePhoneme(x) | ChangePhoneme(x) |
phoneme t# // reduced [t] as in "city" | phoneme t# // reduced [t] as in "city" | ||||
vcd alv stop | vcd alv stop | ||||
ipa ɾ | |||||
lengthmod 5 | lengthmod 5 | ||||
Vowelin f1=1 f2=1700 -300 300 f3=-100 80 | Vowelin f1=1 f2=1700 -300 300 f3=-100 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-100 80 | Vowelout f1=2 f2=1700 -300 300 f3=-100 80 | ||||
liquid | liquid | ||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPh(isNotVowel) THEN | IF nextPhW(isVowel) THEN | ||||
ELSE | |||||
IF prevPh(isNotVowel) THEN | IF prevPh(isNotVowel) THEN | ||||
ChangePhoneme(l/) | ChangePhoneme(l/) | ||||
ELSE | ELSE | ||||
phoneme r- // linking r, used in English between certain vowels and a following vowel | phoneme r- // linking r, used in English between certain vowels and a following vowel | ||||
liquid rhotic | liquid rhotic | ||||
ipa ɹ | |||||
lengthmod 0 | lengthmod 0 | ||||
NextVowelStarts | NextVowelStarts | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
unstressed | unstressed | ||||
length 140 | length 140 | ||||
IfNextVowelAppend(r-) | ipa ə | ||||
IF thisPh(isWordEnd) THEN | CALL @ | ||||
FMT(vowel/@_6) | |||||
ENDIF | |||||
FMT(vowel/@) | |||||
endphoneme | endphoneme | ||||
phoneme a# | phoneme a# | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
unstressed | unstressed | ||||
length 150 | length 150 | ||||
FMT(vowel/a#_3) | FMT(vowel/a#_3) | ||||
phoneme aa // 'bath' etc. | phoneme aa // 'bath' etc. | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
length 190 | ipa a | ||||
length 185 | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/a) | FMT(vowel/a) | ||||
endphoneme | endphoneme | ||||
phoneme A@ // Used for [A:] when followed by 'r' | phoneme A@ // Used for [A:] when followed by 'r' | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɑː | |||||
length 230 | length 230 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/aa_2) | FMT(vowel/aa_2) | ||||
phoneme i: | phoneme i: | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
length 175 long | length 175 | ||||
IfNextVowelAppend(;) | IfNextVowelAppend(;) | ||||
IF prevPh(w) THEN | IF prevPh(w) THEN | ||||
VowelStart(w/wi2) | VowelStart(w/wi2) | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #o | vowel starttype #o endtype #o | ||||
ipa ɔː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/oo_en) | FMT(vowel/oo_en) | ||||
phoneme o@ | phoneme o@ | ||||
vowel starttype #o endtype #o | vowel starttype #o endtype #o | ||||
ipa ɔː | |||||
length 250 | length 250 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/oo_en) | FMT(vowel/oo_en) | ||||
phoneme oU | phoneme oU | ||||
vowel starttype #@ endtype #u | vowel starttype #@ endtype #u | ||||
ipa əʊ | |||||
length 220 | length 220 | ||||
FMT(vdiph/@u_en) | FMT(vdiph/@u_en) | ||||
endphoneme | endphoneme | ||||
phoneme aI | phoneme aI | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i | ||||
length 240 | length 240 | ||||
IF nextPh(#a) OR nextPh(#o) THEN | |||||
AppendPhoneme(;) | |||||
ENDIF | |||||
FMT(vdiph/ai_2) | FMT(vdiph/ai_2) | ||||
endphoneme | endphoneme | ||||
phoneme IR // used for "ir" when [3:] is split (Scottish) | phoneme IR // used for "ir" when [3:] is split (Scottish) | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 190 | length 190 | ||||
ipa əɹ | |||||
IF nextPhW(r-) THEN | |||||
ipa ə | |||||
ENDIF | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowelr/V_r) | FMT(vowelr/V_r) | ||||
endphoneme | endphoneme | ||||
phoneme VR // used for "or"/"ur" when [3:] is split (Scottish) | phoneme VR // used for "or"/"ur" when [3:] is split (Scottish) | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 210 | length 210 | ||||
ipa ʌɹ | |||||
IF nextPhW(r-) THEN | |||||
ipa ʌ | |||||
ENDIF | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowelr/V3_r) | FMT(vowelr/V3_r) | ||||
endphoneme | endphoneme |
phoneme 3 // Schwa, used for rhotic schwa in American | phoneme 3 // Schwa, used for rhotic schwa in American | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ə | |||||
unstressed | unstressed | ||||
length 140 | length 140 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
phoneme V | phoneme V | ||||
vowel starttype #o endtype #o | vowel starttype #o endtype #o | ||||
ipa ʊ | |||||
length 140 | length 140 | ||||
ChangeIfDiminished(@) | ChangeIfDiminished(@) | ||||
FMT(vowel/o-_2) | FMT(vowel/o-_2) | ||||
phoneme a# | phoneme a# | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
unstressed | unstressed | ||||
length 140 | length 140 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
phoneme A@ | phoneme A@ | ||||
vowel starttype #a endtype #@ | vowel starttype #a endtype #@ | ||||
ipa ɑː | |||||
length 250 | length 250 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/aa_5) | FMT(vowel/aa_5) | ||||
phoneme aa // 'bath' etc. | phoneme aa // 'bath' etc. | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa a | |||||
length 150 | length 150 | ||||
FMT(vowel/a) | FMT(vowel/a) | ||||
endphoneme | endphoneme | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
ipa ɔː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_n/O@) | FMT(vwl_en_n/O@) | ||||
phoneme o@ | phoneme o@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
ipa ɔː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_n/O@) | FMT(vwl_en_n/O@) | ||||
phoneme aU | phoneme aU | ||||
vowel starttype #e endtype #u | vowel starttype #e endtype #u | ||||
ipa æʊ | |||||
length 230 | length 230 | ||||
FMT(vdiph/eeu_3) | FMT(vdiph/eeu_3) | ||||
endphoneme | endphoneme | ||||
phoneme oU | phoneme oU | ||||
vowel starttype #o endtype #o | vowel starttype #o endtype #o | ||||
ipa oː | |||||
length 220 | length 220 | ||||
FMT(vowel/o) | FMT(vowel/o) | ||||
endphoneme | endphoneme | ||||
phoneme eI | phoneme eI | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
ipa eː | |||||
length 210 | length 210 | ||||
FMT(vowel/e) | FMT(vowel/e) | ||||
endphoneme | endphoneme |
phoneme 3 // Schwa, used for rhotic schwa in American | phoneme 3 // Schwa, used for rhotic schwa in American | ||||
import_phoneme @ | vowel starttype #@ endtype #@ | ||||
unstressed | |||||
length 140 | |||||
ipa ə | |||||
CALL @ | |||||
endphoneme | endphoneme | ||||
phoneme a | phoneme a | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa æ | |||||
length 175 | length 175 | ||||
ChangeIfDiminished(a#) | ChangeIfDiminished(a#) | ||||
FMT(vowel/&) | FMT(vowel/&) | ||||
phoneme a# | phoneme a# | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
unstressed | unstressed | ||||
length 150 | length 150 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
phoneme A@ | phoneme A@ | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɑː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_rp/aa) | FMT(vwl_en_rp/aa) | ||||
phoneme aa // 'bath' etc. | phoneme aa // 'bath' etc. | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɑː | |||||
length 200 | length 200 | ||||
FMT(vwl_en_rp/aa) | FMT(vwl_en_rp/aa) | ||||
endphoneme | endphoneme | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
ipa ɔː | |||||
length 230 | length 230 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/oo_1) | FMT(vowel/oo_1) | ||||
phoneme oU | phoneme oU | ||||
vowel starttype #@ endtype #u | vowel starttype #@ endtype #u | ||||
ipa əʊ | |||||
length 220 | length 220 | ||||
FMT(vdiph/@u_2) | FMT(vdiph/@u_2) | ||||
endphoneme | endphoneme | ||||
phoneme aI | phoneme aI | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i | ||||
length 230 | length 230 | ||||
IF nextPh(#a) OR nextPh(#o) THEN | |||||
AppendPhoneme(;) | |||||
ENDIF | |||||
FMT(vdiph/ai_6) | FMT(vdiph/ai_6) | ||||
endphoneme | endphoneme | ||||
phoneme U@ | phoneme U@ | ||||
vowel starttype #u endtype #@ | vowel starttype #u endtype #@ | ||||
ipa ɔː | |||||
length 230 | length 230 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/o_mid) | FMT(vowel/o_mid) |
phoneme aa // 'bath' etc. | phoneme aa // 'bath' etc. | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa a: | |||||
length 220 | length 220 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/a_3) | FMT(vowel/a_3) | ||||
phoneme i // optional variant of [I] for end of words | phoneme i // optional variant of [I] for end of words | ||||
vowel starttype #i endtype #e | vowel starttype #i endtype #e | ||||
ipa e | |||||
length 150 | length 150 | ||||
IfNextVowelAppend(;) | IfNextVowelAppend(;) | ||||
FMT(vowel/e_5) | FMT(vowel/e_5) | ||||
phoneme U | phoneme U | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʉ | |||||
length 140 | length 140 | ||||
FMT(vowel/u#_4) | FMT(vowel/u#_4) | ||||
endphoneme | endphoneme | ||||
phoneme A: | phoneme A: | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
length 220 | length 220 | ||||
ipa a: | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
IF nextPh(r) THEN | IF nextPh(r) THEN | ||||
FMT(vowelr/aa_r, 30) | FMT(vowelr/aa_r, 30) | ||||
phoneme A@ // Used for [A:] when followed by 'r', becomes [A:]+[r] in American | phoneme A@ // Used for [A:] when followed by 'r', becomes [A:]+[r] in American | ||||
vowel starttype #a endtype #@ | vowel starttype #a endtype #@ | ||||
length 250 | length 250 | ||||
ipa aː | |||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vowelr/aa_r) | FMT(vowelr/aa_r) | ||||
endphoneme | endphoneme | ||||
vowel starttype #e endtype #@ | vowel starttype #e endtype #@ | ||||
length 210 | length 210 | ||||
ChangeIfNotStressed(VR) // also need "replace 02 3: VR" in voice file | ChangeIfNotStressed(VR) // also need "replace 02 3: VR" in voice file | ||||
ipa e | |||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vdiph2/e@) | FMT(vdiph2/e@) | ||||
endphoneme | endphoneme | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
length 230 | length 230 | ||||
ipa ɔ | |||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vowelr/oo_r) | FMT(vowelr/oo_r) | ||||
endphoneme | endphoneme | ||||
phoneme o@ | phoneme o@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
length 230 | length 230 | ||||
ipa o | |||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vowelr/o_r) | FMT(vowelr/o_r) | ||||
endphoneme | endphoneme | ||||
phoneme u: | phoneme u: | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʉː | |||||
length 160 | length 160 | ||||
IF nextPh(isVFricative) THEN | IF nextPh(isVFricative) THEN | ||||
Length 200 | Length 200 | ||||
phoneme aU | phoneme aU | ||||
vowel starttype #a endtype #u | vowel starttype #a endtype #u | ||||
ipa ʌʉ | |||||
length 200 | length 200 | ||||
FMT(vdiph/au#) | FMT(vdiph/au#) | ||||
endphoneme | endphoneme | ||||
phoneme oU | phoneme oU | ||||
vowel starttype #o endtype #u | vowel starttype #o endtype #u | ||||
ipa oː | |||||
length 190 | length 190 | ||||
FMT(vowel/o_3) | FMT(vowel/o_3) | ||||
endphoneme | endphoneme | ||||
phoneme eI | phoneme eI | ||||
vowel starttype #e endtype #i | vowel starttype #e endtype #i | ||||
ipa eː | |||||
length 190 | length 190 | ||||
FMT(vowel/e_2) | FMT(vowel/e_2) | ||||
endphoneme | endphoneme | ||||
phoneme e@ | phoneme e@ | ||||
vowel starttype #e endtype #@ | vowel starttype #e endtype #@ | ||||
length 220 | length 220 | ||||
ipa e | |||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vdiph2/e@) | FMT(vdiph2/e@) | ||||
endphoneme | endphoneme | ||||
phoneme i@3 | phoneme i@3 | ||||
vowel starttype #i endtype #@ | vowel starttype #i endtype #@ | ||||
ipa ɪ | |||||
length 220 | length 220 | ||||
AppendPhoneme(r) | AppendPhoneme(r) | ||||
FMT(vowelr/i_r) | FMT(vowelr/i_r) | ||||
phoneme U@ | phoneme U@ | ||||
vowel starttype #u endtype #@ | vowel starttype #u endtype #@ | ||||
ipa ʉɹ | |||||
IF nextPh(r-) THEN | |||||
ipa ʉ | |||||
ENDIF | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vdiph2/u#@) | FMT(vdiph2/u#@) |
phoneme 3 // Schwa, used for rhotic schwa in American | phoneme 3 // Schwa, used for rhotic schwa in American | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɚ | |||||
unstressed | unstressed | ||||
length 210 | length 210 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
phoneme a | phoneme a | ||||
vowel starttype #e endtype #@ | vowel starttype #e endtype #@ | ||||
ipa æ | |||||
length 210 | length 210 | ||||
ChangeIfDiminished(a#) | ChangeIfDiminished(a#) | ||||
phoneme a# | phoneme a# | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
unstressed | unstressed | ||||
length 150 | length 150 | ||||
FMT(vowel/a#_3) | FMT(vowel/a#_3) | ||||
phoneme 0 | phoneme 0 | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
length 200 | length 200 | ||||
ipa ɑː | |||||
ChangeIfDiminished(@) | ChangeIfDiminished(@) | ||||
IF nextPh(r) THEN | IF nextPh(r) THEN | ||||
FMT(vwl_en_us/oor) | ChangePhoneme(O:) | ||||
// FMT(vwl_en_us/oor) | |||||
ENDIF | ENDIF | ||||
FMT(vowel/aa_8) | FMT(vowel/aa_8) | ||||
endphoneme | endphoneme | ||||
phoneme A@ // Used for [A:] when followed by 'r', becomes [A:]+[r] in American | phoneme A@ // Used for [A:] when followed by 'r', becomes [A:]+[r] in American | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɑːɹ | |||||
IF nextPh(r-) THEN | |||||
ipa ɑː | |||||
ENDIF | |||||
length 260 | length 260 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_us/ar) | FMT(vwl_en_us/ar) | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
length 250 | length 250 | ||||
ipa ɔːɹ | |||||
IF nextPhW(r) THEN | |||||
ipa ɔː | |||||
ENDIF | |||||
IfNextVowelAppend(r) | IfNextVowelAppend(r) | ||||
FMT(vwl_en_us/oor) | FMT(vwl_en_us/oor) | ||||
endphoneme | endphoneme | ||||
phoneme o@ | phoneme o@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
length 250 | length 250 | ||||
ipa oːɹ | |||||
IF nextPhW(r) THEN | |||||
ipa oː | |||||
ENDIF | |||||
IfNextVowelAppend(r) | IfNextVowelAppend(r) | ||||
FMT(vwl_en_us/or) | FMT(vwl_en_us/or) | ||||
endphoneme | endphoneme | ||||
phoneme aI | phoneme aI | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i | ||||
length 250 | length 250 | ||||
IF nextPh(#a) OR nextPh(#o) THEN | |||||
AppendPhoneme(;) | |||||
ENDIF | |||||
FMT(vdiph/aae) | FMT(vdiph/aae) | ||||
endphoneme | endphoneme | ||||
phoneme e@ | phoneme e@ | ||||
vowel starttype #e endtype #@ | vowel starttype #e endtype #@ | ||||
length 280 | length 280 | ||||
ipa ɛɹ | |||||
IF nextPhW(r) THEN | |||||
ipa ɛ | |||||
ENDIF | |||||
IfNextVowelAppend(r) | IfNextVowelAppend(r) | ||||
FMT(vwl_en_us/er) | FMT(vwl_en_us/er) | ||||
endphoneme | endphoneme | ||||
phoneme i@3 | phoneme i@3 | ||||
vowel starttype #i endtype #@ | vowel starttype #i endtype #@ | ||||
length 280 | length 280 | ||||
ipa ɪɹ | |||||
IF nextPhW(r) THEN | |||||
ipa ɪ | |||||
ENDIF | |||||
IfNextVowelAppend(r) | IfNextVowelAppend(r) | ||||
FMT(vwl_en_us/ir) | FMT(vwl_en_us/ir) | ||||
endphoneme | endphoneme | ||||
phoneme U@ | phoneme U@ | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 250 | length 250 | ||||
ipa ʊɹ | |||||
IF nextPhW(r-) THEN | |||||
ipa ʊ | |||||
ENDIF | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_us/ur) | FMT(vwl_en_us/ur) | ||||
endphoneme | endphoneme | ||||
phoneme aI@ | phoneme aI@ | ||||
vowel starttype #a endtype #@ | vowel starttype #a endtype #@ | ||||
length 300 | length 300 | ||||
ipa aɪəɹ | |||||
IF nextPhW(r-) THEN | |||||
ipa aɪə | |||||
ENDIF | |||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vwl_en_us/ai@) | FMT(vwl_en_us/ai@) | ||||
endphoneme | endphoneme | ||||
phoneme aU@ | phoneme aU@ | ||||
vowel starttype #a endtype #@ | vowel starttype #a endtype #@ | ||||
length 300 | length 300 | ||||
IfNextVowelAppend(r-) | ipa aɪʊɹ | ||||
IF nextPhW(r) THEN | |||||
ipa aɪʊ | |||||
ENDIF | |||||
IfNextVowelAppend(r) | |||||
FMT(vwl_en_us/aU@) | FMT(vwl_en_us/aU@) | ||||
endphoneme | endphoneme | ||||
phoneme a | phoneme a | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
length 170 | length 160 | ||||
ChangeIfDiminished(a#) | ChangeIfDiminished(a#) | ||||
FMT(vowel/a) | FMT(vowel/a) | ||||
endphoneme | endphoneme | ||||
phoneme V | phoneme V | ||||
vowel starttype #o endtype #o | vowel starttype #o endtype #o | ||||
ipa ʊ | |||||
length 140 | length 140 | ||||
ChangeIfDiminished(@) | ChangeIfDiminished(@) | ||||
FMT(vowel/o-_2) | FMT(vowel/o-_2) | ||||
phoneme a# | phoneme a# | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
unstressed | unstressed | ||||
length 140 | length 140 | ||||
FMT(vowel/a#_3) | FMT(vowel/a#_3) | ||||
phoneme A@ | phoneme A@ | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɑː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/aa_5) | FMT(vowel/aa_5) | ||||
phoneme aa // 'bath' etc. | phoneme aa // 'bath' etc. | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
length 150 | ipa a | ||||
length 160 | |||||
FMT(vowel/a) | FMT(vowel/a) | ||||
endphoneme | endphoneme | ||||
phoneme i: | phoneme i: | ||||
vowel starttype #e endtype #i | vowel starttype #e endtype #i | ||||
ipa ei | |||||
length 220 | length 220 | ||||
IfNextVowelAppend(;) | IfNextVowelAppend(;) | ||||
FMT(vdiph2/ei_3) | FMT(vdiph2/ei_3) | ||||
phoneme O@ | phoneme O@ | ||||
vowel starttype #o endtype #@ | vowel starttype #o endtype #@ | ||||
ipa ɔː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/oo_1) | FMT(vowel/oo_1) | ||||
phoneme u: | phoneme u: | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa əu | |||||
length 200 | length 200 | ||||
FMT(vdiph/@u) | FMT(vdiph/@u) | ||||
endphoneme | endphoneme | ||||
phoneme aU | phoneme aU | ||||
vowel starttype #a endtype #u | vowel starttype #a endtype #u | ||||
ipa æʊ | |||||
length 230 | length 230 | ||||
FMT(vdiph/eeu_3) | FMT(vdiph/eeu_3) | ||||
endphoneme | endphoneme | ||||
phoneme oU | phoneme oU | ||||
vowel starttype #@ endtype #u | vowel starttype #@ endtype #u | ||||
ipa ʌʊ | |||||
length 220 | length 220 | ||||
FMT(vdiph/Vu_2) | FMT(vdiph/Vu_2) | ||||
endphoneme | endphoneme | ||||
phoneme aI | phoneme aI | ||||
vowel starttype #o endtype #i | vowel starttype #o endtype #i | ||||
ipa ɔɪ | |||||
length 240 | length 240 | ||||
FMT(vdiph/ooi_3) | FMT(vdiph/ooi_3) | ||||
endphoneme | endphoneme | ||||
phoneme eI | phoneme eI | ||||
vowel starttype #@ endtype #i | vowel starttype #@ endtype #i | ||||
ipa eː | |||||
length 240 | length 240 | ||||
FMT(vdiph/@i_3) | FMT(vdiph/@i_3) | ||||
endphoneme | endphoneme | ||||
phoneme OI | phoneme OI | ||||
vowel starttype #o endtype #i | vowel starttype #o endtype #i | ||||
ipa oɪ | |||||
length 230 | length 230 | ||||
FMT(vdiph/oi) | FMT(vdiph/oi) | ||||
endphoneme | endphoneme | ||||
phoneme e@ | phoneme e@ | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɜː | |||||
length 240 | length 240 | ||||
IfNextVowelAppend(r-) | IfNextVowelAppend(r-) | ||||
FMT(vowel/3_en) | FMT(vowel/3_en) |
liquid | liquid | ||||
trill | trill | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa r | |||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | ||||
FMT(r3/r_trill_short) addWav(r3/r_trill.wav, 50) | FMT(r3/r_trill_short) addWav(r3/r_trill.wav, 50) |
//==================================================== | //==================================================== | ||||
// French | // French | ||||
//==================================================== | //==================================================== | ||||
// Updated 2010-06-16 Michel Such <michel.such@free.fr> | // Updated 2010-06-22 Michel Such <michel.such@free.fr> | ||||
phoneme #l virtual | phoneme #l virtual | ||||
// Used for l and l/ | // Used for l and l/ | ||||
starttype #r endtype #r | starttype #r endtype #r | ||||
Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | ||||
lengthmod 7 | lengthmod 7 | ||||
ipa U+0281 | |||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
ChangePhoneme(r/) | ChangePhoneme(r/) | ||||
vcd uvl frc | vcd uvl frc | ||||
rhotic | rhotic | ||||
starttype #r endtype #r | starttype #r endtype #r | ||||
ipa U+0281 | |||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
ChangePhoneme(NULL) | ChangePhoneme(NULL) | ||||
starttype #r endtype #r | starttype #r endtype #r | ||||
Vowelout f1=1 f2=1200 -400 800 f3=200 100 len=30 | Vowelout f1=1 f2=1200 -400 800 f3=200 100 len=30 | ||||
lengthmod 7 | lengthmod 7 | ||||
ipa U+0281 | |||||
IF prevPhW(t) OR prevPhW(p) OR prevPhW(k) THEN | IF prevPhW(t) OR prevPhW(p) OR prevPhW(k) THEN | ||||
FMT(vwl_fr/trr) addWav(r3/rx, 15) | FMT(vwl_fr/trr) addWav(r3/rx, 15) | ||||
liquid rhotic uvl nopause | liquid rhotic uvl nopause | ||||
starttype #r endtype #r | starttype #r endtype #r | ||||
Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | ||||
ipa U+0281 | |||||
CALL post_r | CALL post_r | ||||
IF prevPhW(f) OR prevPhW(k) OR prevPhW(p) OR prevPhW(s) OR prevPhW(t) OR prevPhW(S) THEN | IF prevPhW(f) OR prevPhW(k) OR prevPhW(p) OR prevPhW(s) OR prevPhW(t) OR prevPhW(S) THEN | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
palatal | palatal | ||||
length 240 | length 240 | ||||
ipa i | |||||
IfNextVowelAppend(;) | IfNextVowelAppend(;) | ||||
phoneme y | phoneme y | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
length 170 | |||||
IF nextPhW(E~) OR nextPhW(#i) THEN | IF nextPhW(E~) OR nextPhW(#i) THEN | ||||
FMT(vowel/y, -40) | length 110 | ||||
FMT(vowel/y) | |||||
ENDIF | ENDIF | ||||
length 180 | |||||
FMT(vowel/y) | FMT(vowel/y) | ||||
endphoneme | endphoneme | ||||
phoneme E: | phoneme E: | ||||
vowel starttype #e endtype #e | vowel starttype #e endtype #e | ||||
length 200 | length 200 | ||||
FMT(vowel/e_mid2) | FMT(vowel/e_8) | ||||
endphoneme | endphoneme | ||||
phoneme y | phoneme y | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʏ | |||||
length 110 | length 110 | ||||
FMT(vowel/yy_4) | FMT(vowel/yy_4) | ||||
endphoneme | endphoneme | ||||
phoneme pF | phoneme pF | ||||
vls blb afr | vls blb afr | ||||
ipa pf | |||||
Vowelout f1=0 f2=1000 -500 -350 f3=-200 80 | Vowelout f1=0 f2=1000 -500 -350 f3=-200 80 | ||||
lengthmod 2 | lengthmod 2 | ||||
WAV(ufric/f) // could replace this with a [pf] wav file | WAV(ufric/f) // could replace this with a [pf] wav file | ||||
// TESTING | phoneme r // uvular trill or fricative | ||||
phoneme r // uvular trill | |||||
vcd uvl frc | vcd uvl frc | ||||
ipa ʀ | |||||
lengthmod 6 | lengthmod 6 | ||||
length 110 | length 110 | ||||
IF nextPhW(isVowel) THEN | IF nextPhW(isVowel) THEN | ||||
endphoneme | endphoneme | ||||
phoneme UR | |||||
vowel starttype #u endtype #@ | |||||
flag1 | |||||
length 180 | |||||
FMT(vwl_de/uu_@) | |||||
endphoneme | |||||
phoneme V2# // used for 'r' after a vowel (to create a diphthong) | |||||
liquid | |||||
lengthmod 7 | |||||
IF nextPhW(isVowel) THEN | |||||
ChangePhoneme(r") | |||||
ENDIF | |||||
FMT(r/V_2_) | |||||
endphoneme | |||||
phoneme V# // used for 'r' after a vowel (to create a diphthong) | phoneme V# // used for 'r' after a vowel (to create a diphthong) | ||||
liquid | liquid | ||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPhW(isVowel) THEN | IF nextPhW(isVowel) THEN | ||||
ChangePhoneme(r") | ChangePhoneme(r) | ||||
ENDIF | ENDIF | ||||
ipa ɐ | |||||
IF prevPh(#a) OR prevPh(E) THEN | IF prevPh(#a) OR prevPh(E) THEN | ||||
FMT(r/V_2_) | FMT(r/V_2_) | ||||
ENDIF | ENDIF | ||||
FMT(r/V_) | FMT(r/V_) | ||||
endphoneme | endphoneme | ||||
phoneme V3# | // TESTING | ||||
phoneme V1# | |||||
liquid | liquid | ||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPhW(isVowel) THEN | IF nextPhW(isVowel) THEN | ||||
ChangePhoneme(r") | ChangePhoneme(r") | ||||
ENDIF | ENDIF | ||||
FMT(r/@_) | FMT(r/V_) | ||||
endphoneme | endphoneme | ||||
phoneme V1# | phoneme V2# // used for 'r' after a vowel (to create a diphthong) | ||||
liquid | liquid | ||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPhW(isVowel) THEN | IF nextPhW(isVowel) THEN | ||||
ChangePhoneme(r") | ChangePhoneme(r") | ||||
ENDIF | ENDIF | ||||
FMT(r/V_) | FMT(r/V_2_) | ||||
endphoneme | endphoneme | ||||
phoneme V3# | |||||
liquid | |||||
lengthmod 7 | |||||
IF nextPhW(isVowel) THEN | |||||
ChangePhoneme(r") | |||||
ENDIF | |||||
FMT(r/@_) | |||||
endphoneme | |||||
phoneme UR | |||||
vowel starttype #u endtype #@ | |||||
ipa ʊɐ | |||||
flag1 | |||||
length 180 | |||||
FMT(vwl_de/uu_@) | |||||
endphoneme | |||||
phoneme t. | phoneme t. | ||||
vls rfx stop | vls rfx stop | ||||
lengthmod 2 | lengthmod 2 | ||||
ipa ʈ | |||||
voicingswitch d. | voicingswitch d. | ||||
Vowelin f1=0 f2=1800 -300 300 f3=-400 80 | Vowelin f1=0 f2=1800 -300 300 f3=-400 80 | ||||
Vowelout f1=0 f2=1800 -300 250 f3=-400 80 rms=20 colr=2 | Vowelout f1=0 f2=1800 -300 250 f3=-400 80 rms=20 colr=2 | ||||
phoneme th. | phoneme th. | ||||
vls rfx stop | vls rfx stop | ||||
lengthmod 2 | lengthmod 2 | ||||
ipa ʈh | |||||
voicingswitch dh. | voicingswitch dh. | ||||
Vowelin f1=0 f2=1800 -300 300 f3=-400 80 | Vowelin f1=0 f2=1800 -300 300 f3=-400 80 | ||||
Vowelout f1=0 f2=1800 -300 250 f3=-400 80 rms=20 colr=2 | Vowelout f1=0 f2=1800 -300 250 f3=-400 80 rms=20 colr=2 | ||||
vcd rfx stop | vcd rfx stop | ||||
lengthmod 5 | lengthmod 5 | ||||
voicingswitch t. | voicingswitch t. | ||||
ipa ɖ | |||||
Vowelin f1=1 f2=1800 -300 300 f3=-400 80 | Vowelin f1=1 f2=1800 -300 300 f3=-400 80 | ||||
Vowelout f1=1 f2=1800 -300 300 f3=-400 80 colr=2 | Vowelout f1=1 f2=1800 -300 300 f3=-400 80 colr=2 | ||||
phoneme dh. | phoneme dh. | ||||
vcd rfx stop | vcd rfx stop | ||||
lengthmod 5 | lengthmod 5 | ||||
ipa ɖh | |||||
voicingswitch th. | voicingswitch th. | ||||
Vowelin f1=1 f2=1800 -300 300 f3=-400 80 | Vowelin f1=1 f2=1800 -300 300 f3=-400 80 | ||||
Vowelout f1=1 f2=1800 -300 300 f3=-400 80 colr=2 | Vowelout f1=1 f2=1800 -300 300 f3=-400 80 colr=2 |
phoneme m# | phoneme m# | ||||
vcd blb nasal | vcd blb nasal | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa m# | |||||
Vowelout f1=2 f2=1000 -500 -350 f3=-200 80 brk | Vowelout f1=2 f2=1000 -500 -350 f3=-200 80 brk | ||||
FMT(m/m#_) | FMT(m/m#_) | ||||
endphoneme | endphoneme | ||||
phoneme n# | phoneme n# | ||||
vcd alv nasal | vcd alv nasal | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa n# | |||||
Vowelout f1=2 f2=1700 -300 250 f3=-100 80 rms=20 brk | Vowelout f1=2 f2=1700 -300 250 f3=-100 80 rms=20 brk | ||||
NextVowelStarts | NextVowelStarts | ||||
phoneme n^# | phoneme n^# | ||||
vcd pal nasal palatal | vcd pal nasal palatal | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa ɲ# | |||||
Vowelout f1=3 f2=2300 300 400 f3=100 80 brk rate | Vowelout f1=3 f2=2300 300 400 f3=100 80 brk rate | ||||
FMT(n^/n^#_) | FMT(n^/n^#_) | ||||
endphoneme | endphoneme | ||||
phoneme N# | phoneme N# | ||||
vcd vel nasal | vcd vel nasal | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa ŋ# | |||||
Vowelout f1=3 f2=2300 300 400 f3=-200 80 len=40 rms=20 brk | Vowelout f1=3 f2=2300 300 400 f3=-200 80 len=40 rms=20 brk | ||||
NextVowelStarts | NextVowelStarts | ||||
phoneme l# | phoneme l# | ||||
vls alv frc | vls alv frc | ||||
lengthmod 3 | lengthmod 3 | ||||
ipa l# | |||||
WAV(ufric/l#, 25) | WAV(ufric/l#, 25) | ||||
endphoneme | endphoneme | ||||
phoneme tl# | phoneme tl# | ||||
vls alv stop | vls alv stop | ||||
lengthmod 2 | lengthmod 2 | ||||
ipa tl# | |||||
Vowelin f1=0 f2=1700 -300 300 f3=-100 80 | Vowelin f1=0 f2=1700 -300 300 f3=-100 80 | ||||
Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 | Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 | ||||
WAV(ufric/tl#, 50) | WAV(ufric/tl#, 50) | ||||
phoneme r# // used for [r] when not preceding a vowel | phoneme r# // used for [r] when not preceding a vowel | ||||
liquid | liquid | ||||
lengthmod 2 // | lengthmod 2 // | ||||
ipa r# | |||||
FMT(r3/r#_) addWav(r3/rx) | FMT(r3/r#_) addWav(r3/rx) | ||||
// before n r3/r_n+r3/rx | // before n r3/r_n+r3/rx | ||||
endphoneme | endphoneme |
vls glt apr | vls glt apr | ||||
length 50 | length 50 | ||||
lengthmod 3 | lengthmod 3 | ||||
ipa ʰ | |||||
IF nextPh(#@) THEN | IF nextPh(#@) THEN | ||||
WAV(h/h@) | WAV(h/h@) |
phoneme a# | phoneme a# | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɐ | |||||
length 120 | length 120 | ||||
FMT(vowel/V_6) | FMT(vowel/V_6) | ||||
endphoneme | endphoneme |
phoneme u- | phoneme u- | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʉ | |||||
length 120 | length 120 | ||||
FMT(vwl_no/u#) | FMT(vwl_no/u#) | ||||
endphoneme | endphoneme | ||||
phoneme u-: | phoneme u-: | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʉː | |||||
length 260 | length 260 | ||||
FMT(vwl_no/u#2) | FMT(vwl_no/u#2) | ||||
endphoneme | endphoneme | ||||
phoneme u-I | phoneme u-I | ||||
vowel starttype #u endtype #i | vowel starttype #u endtype #i | ||||
ipa ʉɪ | |||||
length 270 | length 270 | ||||
IfNextVowelAppend(;) | IfNextVowelAppend(;) | ||||
FMT(vdiph/yi) | FMT(vdiph/yi) |
phoneme a# | phoneme a# | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɐ | |||||
length 170 | length 170 | ||||
FMT(vowel/a#_2) | FMT(vowel/a#_2) | ||||
endphoneme | endphoneme | ||||
phoneme y // close central unrounded (i-bar) | phoneme y // close central unrounded (i-bar) | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
ipa ɨ | |||||
length 180 | length 180 | ||||
FMT(vowel/ii#_2) | FMT(vowel/ii#_2) | ||||
endphoneme | endphoneme | ||||
phoneme R | phoneme R | ||||
liquid | liquid | ||||
trill | trill | ||||
ipa r | |||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk |
phoneme & | phoneme & | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 180 | length 180 | ||||
ipa ɐ | |||||
FMT(vowel/a#_3) | FMT(vowel/a#_3) | ||||
unstressed | unstressed | ||||
endphoneme | endphoneme | ||||
phoneme &/ // Used for final "a" when next word starts with "a" | phoneme &/ // Used for final "a" when next word starts with "a" | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 180 | length 180 | ||||
ipa ɐ | |||||
IF nextPh(isVowel) THEN | IF nextPh(isVowel) THEN | ||||
ChangePhoneme(NULL) | ChangePhoneme(NULL) | ||||
ENDIF | ENDIF | ||||
phoneme &~ | phoneme &~ | ||||
vowel starttype #e endtype #@ | vowel starttype #e endtype #@ | ||||
ipa ɐU+0303 | |||||
length 240 | length 240 | ||||
FMT(vnasal/ee_n2) | FMT(vnasal/ee_n2) | ||||
endphoneme | endphoneme | ||||
phoneme &U~ | phoneme &U~ | ||||
vowel starttype #@ endtype #u | vowel starttype #@ endtype #u | ||||
ipa ɐU+0303ʊU+0303 | |||||
length 240 | length 240 | ||||
FMT(vnasal/a#u_n) | FMT(vnasal/a#u_n) | ||||
endphoneme | endphoneme | ||||
phoneme y | phoneme y | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
length 110 | length 110 | ||||
ipa ɨ | |||||
FMT(vowel/i#_5) | FMT(vowel/i#_5) | ||||
endphoneme | endphoneme | ||||
phoneme i/ // changes to NULL before a vowel | phoneme i/ // changes to NULL before a vowel | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
length 100 | length 100 | ||||
ipa ɨ | |||||
IF nextPh(isVowel) THEN | IF nextPh(isVowel) THEN | ||||
ChangePhoneme(NULL) | ChangePhoneme(NULL) | ||||
ENDIF | ENDIF | ||||
phoneme x // [r] for Portugal | phoneme x // [r] for Portugal | ||||
liquid | liquid | ||||
trill | trill | ||||
ipa ʁ | |||||
lengthmod 7 | lengthmod 7 | ||||
Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | Vowelin f1=0 f2=1500 -400 400 f3=-400 80 | ||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
endphoneme | endphoneme | ||||
phoneme s# // This is [s] for Brazi;, [S] for Portugal | phoneme s# // This is [s] for Brazil, [S] for Portugal | ||||
import_phoneme base/S | vls pla frc sibilant | ||||
lengthmod 3 | |||||
ipa ʃ | |||||
CALL base/S | |||||
// import_phoneme base/S | |||||
endphoneme | endphoneme | ||||
phoneme &~ | phoneme &~ | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐU+0303 | |||||
length 180 | length 180 | ||||
// ChangeIfNotStressed(&) | // ChangeIfNotStressed(&) | ||||
FMT(vnasal/a#_n) | FMT(vnasal/a#_n) | ||||
phoneme &U~ | phoneme &U~ | ||||
vowel starttype #@ endtype #u | vowel starttype #@ endtype #u | ||||
ipa ɐU+0303ʊU+0303 | |||||
length 240 | length 240 | ||||
FMT(vnasal/a#u_n) | FMT(vnasal/a#u_n) | ||||
endphoneme | endphoneme | ||||
phoneme oI~ | phoneme oI~ | ||||
vowel starttype #o endtype #i | vowel starttype #o endtype #i | ||||
ipa oU+0303ɪU+0303 | |||||
length 260 | length 260 | ||||
FMT(vnasal/oi_n) | FMT(vnasal/oi_n) | ||||
endphoneme | endphoneme | ||||
phoneme x // this is [R] from Slovak/Czech | phoneme x // this is [R] from Slovak/Czech | ||||
liquid | liquid | ||||
trill | trill | ||||
ipa r | |||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | ||||
phoneme s# // This is [s] for Brazi;, [S] for Portugal | phoneme s# // This is [s] for Brazi;, [S] for Portugal | ||||
import_phoneme base/s | vls alv frc sibilant | ||||
lengthmod 3 | |||||
ipa s | |||||
CALL base/s | |||||
endphoneme | endphoneme | ||||
phoneme * | phoneme * | ||||
vcd alv stop | vcd alv stop | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa ɾ | |||||
Vowelin f1=1 f2=1700 -300 300 f3=0 80 | Vowelin f1=1 f2=1700 -300 300 f3=0 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=0 80 | Vowelout f1=2 f2=1700 -300 300 f3=0 80 | ||||
IF PreVoicing THEN | IF PreVoicing THEN |
phoneme I^ // "silent i", palatilizes the preceding consonant | phoneme I^ // "silent i", palatilizes the preceding consonant | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
unstressed | unstressed | ||||
ipa ʲ | |||||
length 70 | length 70 | ||||
IF nextPh(isVowel) THEN | IF nextPh(isVowel) THEN | ||||
ChangePhoneme(;) | ChangePhoneme(;) | ||||
phoneme y | phoneme y | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɨ | |||||
length 180 | length 180 | ||||
FMT(vowel/i#_5) | FMT(vowel/i#_5) | ||||
endphoneme | endphoneme |
phoneme & | phoneme & | ||||
vowel starttype #a endtype #a | vowel starttype #a endtype #a | ||||
ipa ɐ | |||||
length 140 | length 140 | ||||
FMT(vowel/a#) | FMT(vowel/a#) | ||||
endphoneme | endphoneme | ||||
phoneme r* // this is [R] from Slovak/Czech | phoneme r* // this is [R] from Slovak/Czech | ||||
liquid | liquid | ||||
trill | trill | ||||
ipa r | |||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk |
phoneme r- | phoneme r- | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa rU+0329 | |||||
length 220 | length 220 | ||||
FMT(vowelr/r-voc) | FMT(vowelr/r-voc) | ||||
endphoneme | endphoneme | ||||
phoneme r: | phoneme r: | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa rU+0329ː | |||||
length 300 | length 300 | ||||
FMT(vowelr/r-voc) | FMT(vowelr/r-voc) | ||||
endphoneme | endphoneme | ||||
phoneme R^ // Czech r-caron | phoneme R^ // Czech r-caron | ||||
vcd pla frc sibilant | vcd pla frc sibilant | ||||
ipa rU+031d | |||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | ||||
phoneme R^/ // Czech r-caron (weaker, for after p,f,t,k) | phoneme R^/ // Czech r-caron (weaker, for after p,f,t,k) | ||||
vcd pla frc sibilant | vcd pla frc sibilant | ||||
ipa rU+031dU+030a | |||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | ||||
phoneme l- | phoneme l- | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa lU+0329 | |||||
length 140 | length 140 | ||||
FMT(vwl_hi/l-voc) | FMT(vwl_hi/l-voc) | ||||
endphoneme | endphoneme | ||||
phoneme l: | phoneme l: | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa lU+0329ː | |||||
length 250 | length 250 | ||||
FMT(vwl_hi/l-voc) | FMT(vwl_hi/l-voc) | ||||
endphoneme | endphoneme |
phoneme v# // a shorter [v], a little towards [b] | phoneme v# // a shorter [v], a little towards [b] | ||||
vcd lbd frc | vcd lbd frc | ||||
ipa v | |||||
lengthmod 6 | lengthmod 6 | ||||
voicingswitch f | voicingswitch f | ||||
Vowelin f1=1 f2=1000 -300 -200 f3=-300 100 | Vowelin f1=1 f2=1000 -300 -200 f3=-300 100 |
phoneme V | phoneme V | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa ɐ | |||||
length 130 | length 130 | ||||
FMT(vowel/V_3) | FMT(vowel/V_3) | ||||
endphoneme | endphoneme | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
length 110 | length 110 | ||||
IF prevPhW(isVel) THEN | IF prevPhW(isVel) THEN | ||||
FMT(vowel/u_bck2) | |||||
ELSE | ELSE | ||||
ChangeIfNotStressed(U) | ChangeIfNotStressed(U) | ||||
ENDIF | ENDIF | ||||
phoneme U | phoneme U | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
length 110 | length 110 | ||||
ipa ʉ | |||||
FMT(vowel/u#_3) | FMT(vowel/u#_3) | ||||
endphoneme | endphoneme | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
length 260 | length 260 | ||||
IF prevPhW(isVel) THEN | IF prevPhW(isVel) THEN | ||||
FMT(vowel/u_bck2) | |||||
ELSE | ELSE | ||||
ChangeIfNotStressed(U:) | ChangeIfNotStressed(U:) | ||||
ENDIF | ENDIF | ||||
phoneme U: | phoneme U: | ||||
vowel starttype #u endtype #u | vowel starttype #u endtype #u | ||||
ipa ʉː | |||||
length 240 | length 240 | ||||
FMT(vowel/u#_3) | FMT(vowel/u#_3) | ||||
endphoneme | endphoneme | ||||
phoneme u- | |||||
vowel starttype #u endtype #u | |||||
length 130 | |||||
FMT(vowel/u#_2) | |||||
endphoneme | |||||
phoneme aI | phoneme aI | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i |
phoneme I | phoneme I | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
ipa ɨ | |||||
length 150 | length 150 | ||||
FMT(vowel/ii_3) | FMT(vowel/ii_3) | ||||
endphoneme | endphoneme | ||||
phoneme y: // symbol used in place of i" (i bar) | phoneme y: // symbol used in place of i" (i bar) | ||||
vowel starttype #i endtype #i | vowel starttype #i endtype #i | ||||
ipa ɨː | |||||
length 180 | length 180 | ||||
ChangeIfNotStressed(Y) | ChangeIfNotStressed(Y) | ||||
FMT(vowel/i#) | FMT(vowel/i#) | ||||
phoneme AY | phoneme AY | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i | ||||
ipa ɑɨ | |||||
length 250 | length 250 | ||||
FMT(vdiph/aai_2) | FMT(vdiph/aai_2) | ||||
endphoneme | endphoneme | ||||
phoneme aY | phoneme aY | ||||
vowel starttype #a endtype #i | vowel starttype #a endtype #i | ||||
ipa aɨ | |||||
length 210 | length 210 | ||||
FMT(vdiph/ai_2) | FMT(vdiph/ai_2) | ||||
endphoneme | endphoneme | ||||
phoneme @Y | phoneme @Y | ||||
vowel starttype #@ endtype #i | vowel starttype #@ endtype #i | ||||
ipa əɨ | |||||
length 210 | length 210 | ||||
FMT(vdiph/@i_2) | FMT(vdiph/@i_2) | ||||
endphoneme | endphoneme | ||||
phoneme Yu | phoneme Yu | ||||
vowel starttype #i endtype #u | vowel starttype #i endtype #u | ||||
ipa ɨu | |||||
length 210 | length 210 | ||||
FMT(vdiph2/iu_4) | FMT(vdiph2/iu_4) | ||||
endphoneme | endphoneme | ||||
phoneme OY | phoneme OY | ||||
vowel starttype #o endtype #i | vowel starttype #o endtype #i | ||||
ipa ɔɨ | |||||
length 210 | length 210 | ||||
FMT(vdiph/ooi) | FMT(vdiph/ooi) | ||||
endphoneme | endphoneme | ||||
phoneme uY | phoneme uY | ||||
vowel starttype #u endtype #i | vowel starttype #u endtype #i | ||||
ipa uɨ | |||||
length 210 | length 210 | ||||
FMT(vdiph/ui_3) | FMT(vdiph/ui_3) | ||||
endphoneme | endphoneme |
phoneme @- // very short schwa | phoneme @- // very short schwa | ||||
vowel nonsyllabic | vowel starttype #@ endtype #@ | ||||
starttype #@ endtype #@ | unstressed nonsyllabic | ||||
unstressed | ipa ə | ||||
IF nextPhW(*) THEN | |||||
ipa NULL | |||||
ENDIF | |||||
length 50 | length 50 | ||||
FMT(vowel/@-) | FMT(vowel/@-) | ||||
endphoneme | endphoneme | ||||
phoneme r- // syllabic r | phoneme r- // syllabic r | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa rU+0329 | |||||
unstressed | unstressed | ||||
length 220 | length 220 | ||||
FMT(vowelr/r-voc) | FMT(vowelr/r-voc) | ||||
phoneme l- // syllabic l | phoneme l- // syllabic l | ||||
vowel starttype #@ endtype #@ | vowel starttype #@ endtype #@ | ||||
ipa lU+0329 | |||||
unstressed | unstressed | ||||
length 200 | length 200 | ||||
FMT(vwl_hi/l-voc) | FMT(vwl_hi/l-voc) | ||||
phoneme r | phoneme r | ||||
liquid rhotic | liquid rhotic | ||||
ipa ɹ | |||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
liquid | liquid | ||||
trill | trill | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa r | |||||
IF nextPhW(R2) THEN | |||||
ipa NULL | |||||
ENDIF | |||||
Vowelin f1=0 f2=1600 -300 300 f3=-200 80 | Vowelin f1=0 f2=1600 -300 300 f3=-200 80 | ||||
Vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk | Vowelout f1=2 f2=1600 -300 300 f3=-200 80 brk | ||||
FMT(r3/r_trill2) addWav(r3/r_trill2.wav, 65) | FMT(r3/r_trill2) addWav(r3/r_trill2.wav, 65) | ||||
liquid | liquid | ||||
trill | trill | ||||
lengthmod 6 | lengthmod 6 | ||||
ipa r | |||||
Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | Vowelin f1=0 f2=1700 -300 300 f3=-300 80 | ||||
Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | Vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk | ||||
FMT(r3/r_trill) addWav(r3/r_trill.wav, 50) | FMT(r3/r_trill) addWav(r3/r_trill.wav, 50) | ||||
trill | trill | ||||
lengthmod 6 | lengthmod 6 | ||||
length 60 | length 60 | ||||
ipa r | |||||
Vowelin f1=2 f2=2700 -300 -200 f3=-1300 80 | Vowelin f1=2 f2=2700 -300 -200 f3=-1300 80 | ||||
Vowelout f1=2 f2=1700 -300 -200 f3=-1300 80 | Vowelout f1=2 f2=1700 -300 -200 f3=-1300 80 | ||||
phoneme r" // uvular trill | phoneme r" // uvular trill | ||||
vcd uvl frc | vcd uvl frc | ||||
ipa ʀ | |||||
lengthmod 6 | lengthmod 6 | ||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
FMT(r3/r_uvl) addWav(r3/r_uvl.wav, 50) | FMT(r3/r_uvl) addWav(r3/r_uvl.wav, 50) | ||||
phoneme l^ // palatal l | phoneme l^ // palatal l | ||||
liquid | liquid | ||||
ipa ʎ | |||||
lengthmod 7 | lengthmod 7 | ||||
Vowelout len=60 lenadd rate | Vowelout len=60 lenadd rate | ||||
length 100 | length 100 | ||||
phoneme l. | phoneme l. | ||||
liquid rfx | liquid rfx | ||||
ipa ɭ | |||||
lengthmod 7 | lengthmod 7 | ||||
FMT(l^/l_rfx) | FMT(l^/l_rfx) | ||||
endphoneme | endphoneme | ||||
liquid palatal | liquid palatal | ||||
lengthmod 7 | lengthmod 7 | ||||
IF nextPh(isVowel) THEN | IF nextPhW(isVowel) THEN | ||||
NextVowelStarts | NextVowelStarts | ||||
VowelStart(j/j@) | VowelStart(j/j@) | ||||
VowelStart(j/ja) | VowelStart(j/ja) | ||||
liquid palatal | liquid palatal | ||||
lengthmod 0 | lengthmod 0 | ||||
IF prevPh(#i) THEN | |||||
ipa NULL // linking after i vowel, don't show in ipa | |||||
ENDIF | |||||
IF nextPh(isNotVowel) THEN | IF nextPh(isNotVowel) THEN | ||||
ChangePhoneme(NULL) // this is to ignore this phoneme if not before a vowel | ChangePhoneme(NULL) // this is to ignore this phoneme if not before a vowel | ||||
ENDIF | ENDIF | ||||
phoneme n. | phoneme n. | ||||
vcd rfx nasal | vcd rfx nasal | ||||
ipa ɳ | |||||
starttype n endtype n | starttype n endtype n | ||||
Vowelin f1=2 f2=1200 -300 250 f3=-500 80 rms=20 colr=2 | Vowelin f1=2 f2=1200 -300 250 f3=-500 80 rms=20 colr=2 | ||||
Vowelout f1=2 f2=1200 -300 250 f3=-500 80 rms=20 brk colr=2 | Vowelout f1=2 f2=1200 -300 250 f3=-500 80 rms=20 brk colr=2 | ||||
phoneme n^ | phoneme n^ | ||||
vcd pal nasal palatal | vcd pal nasal palatal | ||||
ipa ɲ | |||||
Vowelout f1=3 f2=2500 300 500 f3=100 80 len=45 brk rate | Vowelout f1=3 f2=2500 300 500 f3=100 80 len=45 brk rate | ||||
lengthmod 4 | lengthmod 4 | ||||
phoneme ** // TEST flap | phoneme ** // TEST flap | ||||
liquid alv | liquid alv | ||||
ipa ɾ | |||||
lengthmod 3 | lengthmod 3 | ||||
Vowelout f1=3 f2=1600 -300 300 f3=-300 80 rms=35 len=15 | 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 | Vowelin f1=2 f2=1600 -300 300 f3=-100 80 len=20 | ||||
phoneme * // flap | phoneme * // flap | ||||
vcd alv flp | vcd alv flp | ||||
brkafter | brkafter | ||||
ipa ɾ | |||||
lengthmod 3 | lengthmod 3 | ||||
IF prevPhW(@-) THEN | |||||
ipa r // @-* sequence for [r] | |||||
ENDIF | |||||
IF nextPh(#e) OR nextPh(#i) THEN | IF nextPh(#e) OR nextPh(#i) THEN | ||||
Vowelin f1=0 f2=1500 -300 300 f3=-200 80 | Vowelin f1=0 f2=1500 -300 300 f3=-200 80 | ||||
FMT(d/tap1) addWav(r3/rx, 150) | FMT(d/tap1) addWav(r3/rx, 150) | ||||
phoneme v# // approximant, not fricative | phoneme v# // approximant, not fricative | ||||
vcd lbd frc | vcd lbd frc | ||||
ipa ʋ | |||||
lengthmod 6 | lengthmod 6 | ||||
voicingswitch f | voicingswitch f | ||||
Vowelin f1=0 f2=1000 -300 -200 f3=-300 100 | Vowelin f1=0 f2=1000 -300 -200 f3=-300 100 | ||||
phoneme z. | phoneme z. | ||||
vcd pla frc sibilant | vcd pla frc sibilant | ||||
ipa ʐ | |||||
voicingswitch s. | voicingswitch s. | ||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=0 f2=1800 -100 300 f3=-300 80 | Vowelin f1=0 f2=1800 -100 300 f3=-300 80 | ||||
phoneme z; | phoneme z; | ||||
vcd pal frc sibilant palatal | vcd pal frc sibilant palatal | ||||
ipa ʑ | |||||
voicingswitch s; | voicingswitch s; | ||||
lengthmod 6 | lengthmod 6 | ||||
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 | ||||
phoneme J^ // palatal fricative (Kirshenbaum C<vcd>) | phoneme J^ // palatal fricative (Kirshenbaum C<vcd>) | ||||
vcd pal frc palatal | vcd pal frc palatal | ||||
ipa ʝ | |||||
voicingswitch C | voicingswitch C | ||||
lengthmod 6 | lengthmod 6 | ||||
Vowelin f1=1 f2=2700 400 600 f3=200 70 | Vowelin f1=1 f2=2700 400 600 f3=200 70 | ||||
endphoneme | endphoneme | ||||
phoneme Q" // voiced velar fricative | phoneme Q" | ||||
vcd uvl frc | vcd uvl frc | ||||
ipa ʁ | |||||
lengthmod 6 | lengthmod 6 | ||||
IF nextPh(isPause2) THEN | IF nextPh(isPause2) THEN | ||||
phoneme s. | phoneme s. | ||||
vls pla frc sibilant | vls pla frc sibilant | ||||
ipa ʂ | |||||
voicingswitch z. | voicingswitch z. | ||||
lengthmod 3 | lengthmod 3 | ||||
Vowelin f1=0 f2=1800 -100 300 f3=-300 80 | Vowelin f1=0 f2=1800 -100 300 f3=-300 80 | ||||
phoneme s; | phoneme s; | ||||
vls pal frc sibilant palatal | vls pal frc sibilant palatal | ||||
ipa ʂ | |||||
voicingswitch z; | voicingswitch z; | ||||
lengthmod 3 | lengthmod 3 | ||||
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 | ||||
phoneme l# // Lateral fricative (eg. Welsh "ll") | phoneme l# // Lateral fricative (eg. Welsh "ll") | ||||
vls alv frc | vls alv frc | ||||
ipa ɬ | |||||
lengthmod 3 | lengthmod 3 | ||||
NextVowelStarts | NextVowelStarts | ||||
phoneme h | phoneme h | ||||
vls glt apr | vls glt apr | ||||
lengthmod 3 | lengthmod 3 | ||||
ipa h | |||||
IF nextPh(#@) THEN | IF nextPh(#@) THEN | ||||
WAV(h/h@) | WAV(h/h@) | ||||
phonemetable nso base | phonemetable nso base | ||||
include ph_northern-sotho | include ph_northern-sotho | ||||
phonemetable ht fr | |||||
include ph_haitian |
typedef enum { | typedef enum { | ||||
espeakEVENT_LIST_TERMINATED = 0, // Retrieval mode: terminates the event list. | espeakEVENT_LIST_TERMINATED = 0, // Retrieval mode: terminates the event list. | ||||
espeakEVENT_WORD = 1, // Start of word | espeakEVENT_WORD = 1, // Start of word | ||||
espeakEVENT_SENTENCE, // Start of sentence | espeakEVENT_SENTENCE = 2, // Start of sentence | ||||
espeakEVENT_MARK, // Mark | espeakEVENT_MARK = 3, // Mark | ||||
espeakEVENT_PLAY, // Audio element | espeakEVENT_PLAY = 4, // Audio element | ||||
espeakEVENT_END, // End of sentence or clause | espeakEVENT_END = 5, // End of sentence or clause | ||||
espeakEVENT_MSG_TERMINATED, // End of message | espeakEVENT_MSG_TERMINATED = 6, // End of message | ||||
espeakEVENT_PHONEME // Phoneme, if enabled in espeak_Initialize() | espeakEVENT_PHONEME = 7, // Phoneme, if enabled in espeak_Initialize() | ||||
espeakEVENT_SAMPLERATE = 8 // internal use, set sample rate | |||||
} espeak_EVENT_TYPE; | } espeak_EVENT_TYPE; | ||||
const char *name; // used for MARK and PLAY events. UTF8 string | const char *name; // used for MARK and PLAY events. UTF8 string | ||||
} id; | } id; | ||||
} espeak_EVENT; | } espeak_EVENT; | ||||
/* | /* | ||||
When a message is supplied to espeak_synth, the request is buffered and espeak_synth returns. When the message is really processed, the callback function will be repetedly called. | When a message is supplied to espeak_synth, the request is buffered and espeak_synth returns. When the message is really processed, the callback function will be repetedly called. | ||||
In PLAYBACK mode, the callback function is called as soon as an event happens. | In PLAYBACK mode, the callback function is called as soon as an event happens. | ||||
For example suppose that the following message is supplied to espeak_Synth: | For example suppose that the following message is supplied to espeak_Synth: | ||||
"hello, hello." | "hello, hello." | ||||
* Once processed in RETRIEVAL mode, it could lead to 3 calls of the callback function : | * Once processed in RETRIEVAL mode, it could lead to 3 calls of the callback function : | ||||
** Block 1: | ** Block 1: | ||||
<audio data> + | <audio data> + | ||||
List of events: SENTENCE + WORD + LIST_TERMINATED | List of events: SENTENCE + WORD + LIST_TERMINATED | ||||
** Block 2: | ** Block 2: | ||||
<audio data> + | <audio data> + | ||||
List of events: WORD + END + LIST_TERMINATED | List of events: WORD + END + LIST_TERMINATED | ||||
typedef enum { | typedef enum { | ||||
/* PLAYBACK mode: plays the audio data, supplies events to the calling program*/ | /* PLAYBACK mode: plays the audio data, supplies events to the calling program*/ | ||||
AUDIO_OUTPUT_PLAYBACK, | AUDIO_OUTPUT_PLAYBACK, | ||||
/* RETRIEVAL mode: supplies audio data and events to the calling program */ | /* RETRIEVAL mode: supplies audio data and events to the calling program */ | ||||
AUDIO_OUTPUT_RETRIEVAL, | AUDIO_OUTPUT_RETRIEVAL, | ||||
/* SYNCHRONOUS mode: as RETRIEVAL but doesn't return until synthesis is completed */ | /* SYNCHRONOUS mode: as RETRIEVAL but doesn't return until synthesis is completed */ | ||||
AUDIO_OUTPUT_SYNCHRONOUS, | AUDIO_OUTPUT_SYNCHRONOUS, | ||||
ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); | ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); | ||||
/* Must be called before any synthesis functions are called. | /* Must be called before any synthesis functions are called. | ||||
This specifies a function in the calling program which is called when a buffer of | This specifies a function in the calling program which is called when a buffer of | ||||
speech sound data has been produced. | speech sound data has been produced. | ||||
The callback function is of the form: | The callback function is of the form: | ||||
start of the text. | start of the text. | ||||
position_type: Determines whether "position" is a number of characters, words, or sentences. | position_type: Determines whether "position" is a number of characters, words, or sentences. | ||||
Values: | Values: | ||||
end_position: If set, this gives a character position at which speaking will stop. A value | end_position: If set, this gives a character position at which speaking will stop. A value | ||||
of zero indicates no end position. | of zero indicates no end position. | ||||
espeakENDPAUSE If set then a sentence pause is added at the end of the text. If not set then | espeakENDPAUSE If set then a sentence pause is added at the end of the text. If not set then | ||||
this pause is suppressed. | this pause is suppressed. | ||||
unique_identifier: message identifier; helpful for identifying later | unique_identifier: message identifier; helpful for identifying later | ||||
data supplied to the callback. | data supplied to the callback. | ||||
user_data: pointer which will be passed to the callback function. | user_data: pointer which will be passed to the callback function. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
For the other parameters, see espeak_Synth() | For the other parameters, see espeak_Synth() | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
If key_name is a single character, it speaks the name of the character. | If key_name is a single character, it speaks the name of the character. | ||||
Otherwise, it speaks key_name as a text string. | Otherwise, it speaks key_name as a text string. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
extern "C" | extern "C" | ||||
#endif | #endif | ||||
ESPEAK_API espeak_ERROR espeak_Char(wchar_t character); | ESPEAK_API espeak_ERROR espeak_Char(wchar_t character); | ||||
/* Speak the name of the given character | /* Speak the name of the given character | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
espeakRANGE: pitch range, range 0-100. 0-monotone, 50=normal | espeakRANGE: pitch range, range 0-100. 0-monotone, 50=normal | ||||
espeakPUNCTUATION: which punctuation characters to announce: | espeakPUNCTUATION: which punctuation characters to announce: | ||||
value in espeak_PUNCT_TYPE (none, all, some), | value in espeak_PUNCT_TYPE (none, all, some), | ||||
see espeak_GetParameter() to specify which characters are announced. | see espeak_GetParameter() to specify which characters are announced. | ||||
espeakCAPITALS: announce capital letters by: | espeakCAPITALS: announce capital letters by: | ||||
espeakWORDGAP: pause between words, units of 10mS (at the default speed) | espeakWORDGAP: pause between words, units of 10mS (at the default speed) | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
punctlist: A list of character codes, terminated by a zero character. | punctlist: A list of character codes, terminated by a zero character. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
unsigned char gender; // 0=none 1=male, 2=female, | unsigned char gender; // 0=none 1=male, 2=female, | ||||
unsigned char age; // 0=not specified, or age in years | unsigned char age; // 0=not specified, or age in years | ||||
unsigned char variant; // only used when passed as a parameter to espeak_SetVoiceByProperties | unsigned char variant; // only used when passed as a parameter to espeak_SetVoiceByProperties | ||||
unsigned char xx1; // for internal use | unsigned char xx1; // for internal use | ||||
int score; // for internal use | int score; // for internal use | ||||
void *spare; // for internal use | void *spare; // for internal use | ||||
} espeak_VOICE; | } espeak_VOICE; | ||||
/* Searches for a voice with a matching "name" field. Language is not considered. | /* Searches for a voice with a matching "name" field. Language is not considered. | ||||
"name" is a UTF8 string. | "name" is a UTF8 string. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_BUFFER_FULL: the command can not be buffered; | EE_BUFFER_FULL: the command can not be buffered; | ||||
you may try after a while to call the function again. | you may try after a while to call the function again. | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
function returns, the audio output is fully stopped and the synthesizer is ready to | function returns, the audio output is fully stopped and the synthesizer is ready to | ||||
synthesize a new message. | synthesize a new message. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
#endif | #endif | ||||
ESPEAK_API espeak_ERROR espeak_Synchronize(void); | ESPEAK_API espeak_ERROR espeak_Synchronize(void); | ||||
/* This function returns when all data have been spoken. | /* This function returns when all data have been spoken. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
#endif | #endif | ||||
ESPEAK_API espeak_ERROR espeak_Terminate(void); | ESPEAK_API espeak_ERROR espeak_Terminate(void); | ||||
/* last function to be called. | /* last function to be called. | ||||
Return: EE_OK: operation achieved | Return: EE_OK: operation achieved | ||||
EE_INTERNAL_ERROR. | EE_INTERNAL_ERROR. | ||||
*/ | */ | ||||
The parameter is for future use, and should be set to NULL | The parameter is for future use, and should be set to NULL | ||||
*/ | */ | ||||
#endif | #endif | ||||
extern void FindPhonemesUsed(void); | extern void FindPhonemesUsed(void); | ||||
extern void DisplayErrorFile(const char *fname); | extern void DisplayErrorFile(const char *fname); | ||||
extern int utf8_out(unsigned int c, char *buf); | |||||
char path_source[sizeof(path_home)+20]; | char path_source[sizeof(path_home)+20]; | ||||
{"LengthAdd", tINSTRN1, i_ADD_LENGTH}, | {"LengthAdd", tINSTRN1, i_ADD_LENGTH}, | ||||
{"Lengthmod", tINSTRN1, i_LENGTH_MOD}, | {"Lengthmod", tINSTRN1, i_LENGTH_MOD}, | ||||
{"lengthmod", tINSTRN1, i_LENGTH_MOD}, | {"lengthmod", tINSTRN1, i_LENGTH_MOD}, | ||||
{"ipa", tINSTRN1, i_IPA_NAME}, | |||||
// flags | // flags | ||||
{"wavef", tPHONEME_FLAG, phWAVE}, | {"wavef", tPHONEME_FLAG, phWAVE}, | ||||
int ix; | int ix; | ||||
int any; | int any; | ||||
const char *name; | const char *name; | ||||
char buf[120]; | |||||
static const char *INV = "Invalid"; | static const char *INV = "Invalid"; | ||||
fprintf(f_out,"%s",instn0_string[data1]); | fprintf(f_out,"%s",instn0_string[data1]); | ||||
} | } | ||||
else | else | ||||
if(type2 == i_IPA_NAME) | |||||
{ | |||||
for(ix = 0; ix < data1; ix += 2) | |||||
{ | |||||
instn = *pc++; | |||||
buf[ix] = instn >> 8; | |||||
buf[ix+1] = instn & 0xff; | |||||
} | |||||
buf[ix] = 0; | |||||
fprintf(f_out,"ipa %s",buf); | |||||
} | |||||
else | |||||
{ | { | ||||
fprintf(f_out,"%s(",KeyToMnem(keywords, tINSTRN1, type2)); | fprintf(f_out,"%s(",KeyToMnem(keywords, tINSTRN1, type2)); | ||||
switch(instn1_paramtype[type2]) | switch(instn1_paramtype[type2]) | ||||
int keyword; | int keyword; | ||||
int value; | int value; | ||||
int phcode = 0; | int phcode = 0; | ||||
int ix; | |||||
unsigned int c; | |||||
char *p; | |||||
char number_buf[12]; | |||||
char ipa_buf[N_ITEM_STRING]; | |||||
PHONEME_TAB phoneme_out2; | PHONEME_TAB phoneme_out2; | ||||
PHONEME_PROG_LOG phoneme_prog_log; | PHONEME_PROG_LOG phoneme_prog_log; | ||||
value = NextItem(tNUMBER); | value = NextItem(tNUMBER); | ||||
phoneme_out->length_mod = value; | phoneme_out->length_mod = value; | ||||
break; | break; | ||||
case i_IPA_NAME: | |||||
NextItem(tSTRING); | |||||
if(strcmp(item_string,"NULL")==0) | |||||
strcpy(item_string," "); | |||||
// copy the string, recognize characters in the form U+9999 | |||||
p = item_string; | |||||
ix = 0; | |||||
while((c = *p++) != 0) | |||||
{ | |||||
if((c=='U') && (p[0]=='+')) | |||||
{ | |||||
// U+9999 | |||||
memcpy(number_buf,&p[1],4); // U+ should be followed by 4 hex digits | |||||
number_buf[4] = 0; | |||||
c = 0; | |||||
sscanf(number_buf,"%x",&c); | |||||
p += 5; | |||||
ix += utf8_out(c, &ipa_buf[ix]); | |||||
} | |||||
else | |||||
{ | |||||
ipa_buf[ix++] = c; | |||||
} | |||||
} | |||||
ipa_buf[ix] = 0; | |||||
value = strlen(ipa_buf); // number of UTF-8 bytes | |||||
*prog_out++ = (i_IPA_NAME << 8) + value; | |||||
for(ix=0; ix < value; ix += 2) | |||||
{ | |||||
*prog_out++ = (ipa_buf[ix] << 8) + (ipa_buf[ix+1] & 0xff); | |||||
} | |||||
break; | |||||
} | } | ||||
break; | break; | ||||
case kSTRESSTYPE: | case kSTRESSTYPE: | ||||
value = NextItem(tNUMBER); | value = NextItem(tNUMBER); | ||||
phoneme_out->std_length = value; | phoneme_out->std_length = value; | ||||
if(prog_out > prog_buf) | |||||
{ | |||||
error("stress phonemes can't contain program instructions",NULL); | |||||
prog_out = prog_buf; | |||||
} | |||||
break; | break; | ||||
case kIF: | case kIF: |
} // end of DecodePhonemes | } // end of DecodePhonemes | ||||
// using Kirschenbaum to IPA translation, ascii 0x20 to 0x7f | |||||
unsigned short ipa1[96] = { | |||||
0x20,0x21,0x22,0x2b0,0x24,0x25,0x0e6,0x2c8,0x28,0x27e,0x2a,0x2b,0x2cc,0x2d,0x2e,0x2f, | |||||
0x252,0x31,0x32,0x25c,0x34,0x35,0x36,0x37,0x275,0x39,0x2d0,0x2b2,0x3c,0x3d,0x3e,0x294, | |||||
0x259,0x251,0x3b2,0xe7,0xf0,0x25b,0x46,0x262,0x127,0x26a,0x25f,0x4b,0x4c,0x271,0x14b,0x254, | |||||
0x3a6,0x263,0x280,0x283,0x3b8,0x28a,0x28c,0x153,0x3c7,0xf8,0x292,0x32a,0x5c,0x5d,0x5e,0x5f, | |||||
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, | |||||
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x303,0x7f | |||||
}; | |||||
static void WritePhMnemonic(char *phon_out, int *ix, PHONEME_TAB *ph, PHONEME_LIST *plist) | |||||
{//======================================================================================= | |||||
int c; | |||||
int mnem; | |||||
int len; | |||||
int first; | |||||
unsigned int ipa_control=0; // first byte of ipa string may control the phoneme name interpretation. 0x20 = ignore this phoneme | |||||
PHONEME_DATA phdata; | |||||
static void WriteMnemonic(char *phon_out, int *ix, int mnem) | if(option_phonemes == 3) | ||||
{//========================================================= | { | ||||
unsigned char c; | // has an ipa name been defined for this phoneme ? | ||||
phdata.ipa_string[0] = 0; | |||||
if(plist == NULL) | |||||
{ | |||||
InterpretPhoneme2(ph->code, &phdata); | |||||
} | |||||
else | |||||
{ | |||||
InterpretPhoneme(NULL, 0, plist, &phdata); | |||||
} | |||||
len = strlen(phdata.ipa_string); | |||||
if(len > 0) | |||||
{ | |||||
if((ipa_control = phdata.ipa_string[0]) > 0x20) | |||||
{ | |||||
strcpy(&phon_out[*ix], phdata.ipa_string); | |||||
*ix += len; | |||||
} | |||||
if(ipa_control >= 0x20) | |||||
return; // 0x20 = ignore phoneme | |||||
} | |||||
} | |||||
while((c = mnem & 0xff) != 0) | first = 1; | ||||
for(mnem = ph->mnemonic; (c = mnem & 0xff) != 0; mnem = mnem >> 8) | |||||
{ | { | ||||
if((c == '/') && (option_phoneme_variants==0)) | if((c == '/') && (option_phoneme_variants==0)) | ||||
break; // discard phoneme variant indicator | break; // discard phoneme variant indicator | ||||
phon_out[(*ix)++]= c; | if(option_phonemes == 3) | ||||
// phon_out[phon_out_ix++]= ipa1[c]; | { | ||||
mnem = mnem >> 8; | // convert from ascii to ipa | ||||
if(first && (c == '_')) | |||||
break; // don't show pause phonemes | |||||
if((c == '#') && (ph->type == phVOWEL)) | |||||
break; // # is subscript-h, but only for consonants | |||||
// ignore digits after the first character | |||||
if(!first && isdigit(c)) | |||||
continue; | |||||
if((c >= 0x20) && (c < 128)) | |||||
c = ipa1[c-0x20]; | |||||
*ix += utf8_out(c, &phon_out[*ix]); | |||||
} | |||||
else | |||||
{ | |||||
phon_out[(*ix)++]= c; | |||||
} | |||||
first = 0; | |||||
} | } | ||||
} | } // end of WritePhMnemonic | ||||
int ix; | int ix; | ||||
int phon_out_ix=0; | int phon_out_ix=0; | ||||
int stress; | int stress; | ||||
unsigned int c; | |||||
char *p; | char *p; | ||||
PHONEME_LIST *plist; | PHONEME_LIST *plist; | ||||
{ | { | ||||
if((stress = plist->stresslevel) > 1) | if((stress = plist->stresslevel) > 1) | ||||
{ | { | ||||
c = 0; | |||||
if(stress > 5) stress = 5; | if(stress > 5) stress = 5; | ||||
phon_out[phon_out_ix++] = stress_chars[stress]; | if(option_phonemes == 3) | ||||
{ | |||||
c = 0x2cc; // ipa, secondary stress | |||||
if(stress > 3) | |||||
c = 0x02c8; // ipa, primary stress | |||||
} | |||||
else | |||||
{ | |||||
c = stress_chars[stress]; | |||||
} | |||||
if(c != 0) | |||||
{ | |||||
phon_out_ix += utf8_out(c, &phon_out[phon_out_ix]); | |||||
} | |||||
} | } | ||||
} | } | ||||
WriteMnemonic(phon_out, &phon_out_ix, plist->ph->mnemonic); | WritePhMnemonic(phon_out, &phon_out_ix, plist->ph, plist); | ||||
if(plist->synthflags & SFLAG_LENGTHEN) | if(plist->synthflags & SFLAG_LENGTHEN) | ||||
{ | { | ||||
WriteMnemonic(phon_out, &phon_out_ix, phoneme_tab[phonLENGTHEN]->mnemonic); | WritePhMnemonic(phon_out, &phon_out_ix, phoneme_tab[phonLENGTHEN], NULL); | ||||
} | } | ||||
if((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) | if((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) | ||||
{ | { | ||||
// syllablic consonant | // syllablic consonant | ||||
WriteMnemonic(phon_out, &phon_out_ix, phoneme_tab[phonSYLLABIC]->mnemonic); | WritePhMnemonic(phon_out, &phon_out_ix, phoneme_tab[phonSYLLABIC], NULL); | ||||
} | } | ||||
if(plist->ph->code == phonSWITCH) | if(plist->ph->code == phonSWITCH) | ||||
{ | { | ||||
// the tone_ph field contains a phoneme table number | // the tone_ph field contains a phoneme table number | ||||
p = phoneme_tab_list[plist->tone_ph].name; | p = phoneme_tab_list[plist->tone_ph].name; | ||||
while(*p != 0) | while((c = *p++) != 0) | ||||
{ | { | ||||
phon_out[phon_out_ix++] = *p++; | if(option_phonemes != 3) | ||||
phon_out[phon_out_ix++] = c; | |||||
} | } | ||||
phon_out[phon_out_ix++] = ' '; | phon_out[phon_out_ix++] = ' '; | ||||
} | } | ||||
else | else | ||||
if(plist->tone_ph > 0) | if(plist->tone_ph > 0) | ||||
{ | { | ||||
WriteMnemonic(phon_out, &phon_out_ix, phoneme_tab[plist->tone_ph]->mnemonic); | WritePhMnemonic(phon_out, &phon_out_ix, phoneme_tab[plist->tone_ph], NULL); | ||||
} | } | ||||
} | } | ||||
void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, int tonic, int prev_stress) | void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, int tonic, int control) | ||||
{//========================================================================================================= | {//===================================================================================================== | ||||
/* Guess stress pattern of word. This is language specific | /* Guess stress pattern of word. This is language specific | ||||
'output' is used for input and output | |||||
'dictionary_flags' has bits 0-3 position of stressed vowel (if > 0) | 'dictionary_flags' has bits 0-3 position of stressed vowel (if > 0) | ||||
or unstressed (if == 7) or syllables 1 and 2 (if == 6) | or unstressed (if == 7) or syllables 1 and 2 (if == 6) | ||||
bits 8... dictionary flags | bits 8... dictionary flags | ||||
If 'tonic' is set (>= 0), replace highest stress by this value. | If 'tonic' is set (>= 0), replace highest stress by this value. | ||||
Parameter used for input and output | control: bit 0 This is an individual symbol, not a word | ||||
*/ | */ | ||||
unsigned char phcode; | unsigned char phcode; | ||||
p = phonetic; | p = phonetic; | ||||
v = 1; | v = 1; | ||||
if((ph = phoneme_tab[*p]) != NULL) | if(!(control & 1) && ((ph = phoneme_tab[*p]) != NULL)) | ||||
{ | { | ||||
if(ph->type == phSTRESS) | if(ph->type == phSTRESS) | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
LookupLetter(tr, wc, -1, ph_buf); | LookupLetter(tr, wc, -1, ph_buf, 0); | ||||
if(ph_buf[0]) | if(ph_buf[0]) | ||||
{ | { | ||||
match1.phonemes = ph_buf; | match1.phonemes = ph_buf; |
static const char *help_text = | static const char *help_text = | ||||
"\nspeak [options] [\"<words>\"]\n\n" | "\nespeak [options] [\"<words>\"]\n\n" | ||||
"-f <text file> Text file to speak\n" | "-f <text file> Text file to speak\n" | ||||
"--stdin Read text input from stdin instead of a file\n\n" | "--stdin Read text input from stdin instead of a file\n\n" | ||||
"If neither -f nor --stdin, then <words> are spoken, or if none then text\n" | "If neither -f nor --stdin, then <words> are spoken, or if none then text\n" | ||||
"\t Amplitude, 0 to 200, default is 100\n" | "\t Amplitude, 0 to 200, default is 100\n" | ||||
"-g <integer>\n" | "-g <integer>\n" | ||||
"\t Word gap. Pause between words, units of 10mS at the default speed\n" | "\t Word gap. Pause between words, units of 10mS at the default speed\n" | ||||
"-k <integer>\n" | |||||
"\t Indicate capital letters with: 1=sound, 2=the word \"capitals\",\n" | |||||
"\t higher values indicate a pitch increase (try -k20).\n" | |||||
"-l <integer>\n" | "-l <integer>\n" | ||||
"\t Line length. If not zero (which is the default), consider\n" | "\t Line length. If not zero (which is the default), consider\n" | ||||
"\t lines less than this length as end-of-clause\n" | "\t lines less than this length as end-of-clause\n" | ||||
"-v <voice name>\n" | "-v <voice name>\n" | ||||
"\t Use voice file of this name from espeak-data/voices\n" | "\t Use voice file of this name from espeak-data/voices\n" | ||||
"-w <wave file name>\n" | "-w <wave file name>\n" | ||||
"\t Write output to this WAV file, rather than speaking it directly\n" | "\t Write speech to this WAV file, rather than speaking it directly\n" | ||||
"-b\t Input text encoding, 1=UTF8, 2=8 bit, 4=16 bit \n" | "-b\t Input text encoding, 1=UTF8, 2=8 bit, 4=16 bit \n" | ||||
"-m\t Interpret SSML markup, and ignore other < > tags\n" | "-m\t Interpret SSML markup, and ignore other < > tags\n" | ||||
"-q\t Quiet, don't produce any speech (may be useful with -x)\n" | "-q\t Quiet, don't produce any speech (may be useful with -x)\n" | ||||
"-x\t Write phoneme mnemonics to stdout\n" | "-x\t Write phoneme mnemonics to stdout\n" | ||||
"-X\t Write phonemes mnemonics and translation trace to stdout\n" | "-X\t Write phonemes mnemonics and translation trace to stdout\n" | ||||
"-z\t No final sentence pause at the end of the text\n" | "-z\t No final sentence pause at the end of the text\n" | ||||
"--stdout Write speech output to stdout\n" | |||||
"--compile=<voice name>\n" | "--compile=<voice name>\n" | ||||
"\t Compile the pronunciation rules and dictionary in the current\n" | "\t Compile pronunciation rules and dictionary from the current\n" | ||||
"\t directory. <voice name> specifies the language\n" | "\t directory. <voice name> specifies the language\n" | ||||
"--ipa Write phonemes to stdout using International Phonetic Alphabet\n" | |||||
"--path=\"<path>\"\n" | "--path=\"<path>\"\n" | ||||
"\t Specifies the directory containing the espeak-data directory\n" | "\t Specifies the directory containing the espeak-data directory\n" | ||||
"--pho\n" | "--pho Write mbrola phoneme data (.pho) to stdout or to the file in --phonout\n" | ||||
"\t Write mbrola phoneme data (.pho) to stdout, or to the file in --phonout\n" | |||||
"--phonout=\"<filename>\"\n" | "--phonout=\"<filename>\"\n" | ||||
"\t Write phoneme output from -x -X and --pho to this file\n" | "\t Write phoneme output from -x -X --ipa and --pho to this file\n" | ||||
"--punct=\"<characters>\"\n" | "--punct=\"<characters>\"\n" | ||||
"\t Speak the names of punctuation characters during speaking. If\n" | "\t Speak the names of punctuation characters during speaking. If\n" | ||||
"\t =<characters> is omitted, all punctuation is spoken.\n" | "\t =<characters> is omitted, all punctuation is spoken.\n" | ||||
"--split=\"<minutes>\"\n" | "--split=\"<minutes>\"\n" | ||||
"\t Starts a new WAV file every <minutes>. Used with -w\n" | "\t Starts a new WAV file every <minutes>. Used with -w\n" | ||||
"--stdout Write speech output to stdout\n" | |||||
"--voices=<language>\n" | "--voices=<language>\n" | ||||
"\t List the available voices for the specified language.\n" | "\t List the available voices for the specified language.\n" | ||||
"\t If <language> is omitted, then list all voices.\n" | "\t If <language> is omitted, then list all voices.\n"; | ||||
"-k <integer>\n" | |||||
"\t Indicate capital letters with: 1=sound, 2=the word \"capitals\",\n" | |||||
"\t higher values indicate a pitch increase (try -k20).\n"; | |||||
{"path", required_argument, 0, 0x107}, | {"path", required_argument, 0, 0x107}, | ||||
{"phonout", required_argument, 0, 0x108}, | {"phonout", required_argument, 0, 0x108}, | ||||
{"pho", no_argument, 0, 0x109}, | {"pho", no_argument, 0, 0x109}, | ||||
{"ipa", no_argument, 0, 0x10a}, | |||||
{0, 0, 0, 0} | {0, 0, 0, 0} | ||||
}; | }; | ||||
case 0x106: // -- split | case 0x106: // -- split | ||||
if(optarg2 == NULL) | if(optarg2 == NULL) | ||||
samples_split = 30 * 60; // default 30 minutes | samples_split_seconds = 30 * 60; // default 30 minutes | ||||
else | else | ||||
samples_split = atoi(optarg2) * 60; | samples_split_seconds = atoi(optarg2) * 60; | ||||
break; | break; | ||||
case 0x107: // --path | case 0x107: // --path | ||||
break; | break; | ||||
case 0x109: // --pho | case 0x109: // --pho | ||||
option_mbrola_phonemes = 8; | option_mbrola_phonemes = 16; | ||||
break; | |||||
case 0x10a: // --ipa | |||||
option_phonemes = 3; | |||||
break; | break; | ||||
default: | default: |
if(strcmp(param,"--compile")==0) | if(strcmp(param,"--compile")==0) | ||||
{ | { | ||||
CompilePhonemeData(); | CompilePhonemeData(); | ||||
CompileIntonation(); | |||||
exit(0); | exit(0); | ||||
} | } | ||||
} | } | ||||
EVT_MENU(MENU_SPECTRUM, MyFrame::OnNewWindow) | EVT_MENU(MENU_SPECTRUM, MyFrame::OnNewWindow) | ||||
EVT_MENU(MENU_SPECTRUM2, MyFrame::OnNewWindow) | EVT_MENU(MENU_SPECTRUM2, MyFrame::OnNewWindow) | ||||
EVT_MENU(MENU_PROSODY, MyFrame::OnProsody) | EVT_MENU(MENU_PROSODY, MyFrame::OnProsody) | ||||
EVT_MENU(MENU_PARAMS, MyFrame::OnOptions) | EVT_MENU(MENU_OPT_SPEED, MyFrame::OnOptions) | ||||
EVT_MENU(MENU_OPT_PUNCT, MyFrame::OnOptions) | |||||
EVT_MENU(MENU_OPT_SPELL, MyFrame::OnOptions) | |||||
EVT_MENU(MENU_PATH0, MyFrame::OnOptions) | EVT_MENU(MENU_PATH0, MyFrame::OnOptions) | ||||
EVT_MENU(MENU_PATH1, MyFrame::OnOptions) | EVT_MENU(MENU_PATH1, MyFrame::OnOptions) | ||||
EVT_MENU(MENU_PATH2, MyFrame::OnOptions) | EVT_MENU(MENU_PATH2, MyFrame::OnOptions) | ||||
EVT_MENU(MENU_QUIT, MyFrame::OnQuit) | EVT_MENU(MENU_QUIT, MyFrame::OnQuit) | ||||
EVT_MENU(MENU_SPEAK_TRANSLATE, MyFrame::OnSpeak) | EVT_MENU(MENU_SPEAK_TRANSLATE, MyFrame::OnSpeak) | ||||
EVT_MENU(MENU_SPEAK_RULES, MyFrame::OnSpeak) | EVT_MENU(MENU_SPEAK_RULES, MyFrame::OnSpeak) | ||||
EVT_MENU(MENU_SPEAK_IPA, MyFrame::OnSpeak) | |||||
EVT_MENU(MENU_SPEAK_TEXT, MyFrame::OnSpeak) | EVT_MENU(MENU_SPEAK_TEXT, MyFrame::OnSpeak) | ||||
EVT_MENU(MENU_SPEAK_FILE, MyFrame::OnSpeak) | EVT_MENU(MENU_SPEAK_FILE, MyFrame::OnSpeak) | ||||
EVT_MENU(MENU_SPEAK_STOP, MyFrame::OnSpeak) | EVT_MENU(MENU_SPEAK_STOP, MyFrame::OnSpeak) | ||||
switch(event_id) | switch(event_id) | ||||
{ | { | ||||
case MENU_PARAMS: | case MENU_OPT_SPEED: | ||||
value = wxGetNumberFromUser(_T(""),_T(""),_T("Speed"),option_speed,80,500); | value = wxGetNumberFromUser(_T(""),_T(""),_T("Speed"),option_speed,80,500); | ||||
if(value > 0) | if(value > 0) | ||||
{ | { | ||||
} | } | ||||
break; | break; | ||||
case MENU_OPT_PUNCT: | |||||
transldlg->t_source->SetValue(_T("<tts:style field=\"punctuation\" mode=\"all\">\n")); | |||||
transldlg->t_source->SetInsertionPointEnd(); | |||||
notebook->SetSelection(1); | |||||
break; | |||||
case MENU_OPT_SPELL: | |||||
transldlg->t_source->SetValue(_T("<say-as interpret-as=\"tts:char\">\n")); | |||||
transldlg->t_source->SetInsertionPointEnd(); | |||||
notebook->SetSelection(1); | |||||
break; | |||||
case MENU_PATH0: | case MENU_PATH0: | ||||
string = wxFileSelector(_T("Master phonemes file"),wxFileName(path_phfile).GetPath(), | string = wxFileSelector(_T("Master phonemes file"),wxFileName(path_phfile).GetPath(), | ||||
_T(""),_T(""),_T("*"),wxOPEN); | _T(""),_T(""),_T("*"),wxOPEN); | ||||
{ | { | ||||
case MENU_SPEAK_TRANSLATE: | case MENU_SPEAK_TRANSLATE: | ||||
case MENU_SPEAK_RULES: | case MENU_SPEAK_RULES: | ||||
case MENU_SPEAK_IPA: | |||||
case MENU_SPEAK_TEXT: | case MENU_SPEAK_TEXT: | ||||
transldlg->OnCommand(event); | transldlg->OnCommand(event); | ||||
break; | break; |
unsigned char *envelope_data[20] = { | unsigned char *envelope_data[N_ENVELOPE_DATA] = { | ||||
env_fall, env_fall, | env_fall, env_fall, | ||||
env_rise, env_rise, | env_rise, env_rise, | ||||
env_frise, env_r_frise, | env_frise, env_r_frise, |
temp = (temp * kt_globals.fadeout) / 64; | temp = (temp * kt_globals.fadeout) / 64; | ||||
} | } | ||||
value = int(temp) + ((echo_buf[echo_tail++]*echo_amp) >> 8); | value = (int)temp + ((echo_buf[echo_tail++]*echo_amp) >> 8); | ||||
if(echo_tail >= N_ECHO_BUF) | if(echo_tail >= N_ECHO_BUF) | ||||
echo_tail=0; | echo_tail=0; | ||||
return(0); | return(0); | ||||
} | } | ||||
return(double(amptable[dB]) * 0.001); | return((double)(amptable[dB]) * 0.001); | ||||
} | } | ||||
for(ix=0; ix < N_KLATTP; ix++) | for(ix=0; ix < N_KLATTP; ix++) | ||||
{ | { | ||||
klattp1[ix] += klattp_inc[ix]; | klattp1[ix] += klattp_inc[ix]; | ||||
klattp[ix] = int(klattp1[ix]); | klattp[ix] = (int)klattp1[ix]; | ||||
} | } | ||||
for(ix=0; ix<=6; ix++) | for(ix=0; ix<=6; ix++) | ||||
else | else | ||||
{ | { | ||||
klattp1[ix] = klattp[ix] = fr1->klattp[ix]; | klattp1[ix] = klattp[ix] = fr1->klattp[ix]; | ||||
klattp_inc[ix] = double((fr2->klattp[ix] - klattp[ix]) * STEPSIZE)/length; | klattp_inc[ix] = (double)((fr2->klattp[ix] - klattp[ix]) * STEPSIZE)/length; | ||||
} | } | ||||
// get klatt parameter adjustments for the voice | // get klatt parameter adjustments for the voice | ||||
for(ix=1; ix < 6; ix++) | for(ix=1; ix < 6; ix++) | ||||
{ | { | ||||
peaks[ix].freq1 = (fr1->ffreq[ix] * v->freq[ix] / 256.0) + v->freqadd[ix]; | peaks[ix].freq1 = (fr1->ffreq[ix] * v->freq[ix] / 256.0) + v->freqadd[ix]; | ||||
peaks[ix].freq = int(peaks[ix].freq1); | peaks[ix].freq = (int)peaks[ix].freq1; | ||||
next = (fr2->ffreq[ix] * v->freq[ix] / 256.0) + v->freqadd[ix]; | next = (fr2->ffreq[ix] * v->freq[ix] / 256.0) + v->freqadd[ix]; | ||||
peaks[ix].freq_inc = ((next - peaks[ix].freq1) * STEPSIZE) / length; | peaks[ix].freq_inc = ((next - peaks[ix].freq1) * STEPSIZE) / length; | ||||
{ | { | ||||
// klatt bandwidth for f1, f2, f3 (others are fixed) | // klatt bandwidth for f1, f2, f3 (others are fixed) | ||||
peaks[ix].bw1 = fr1->bw[ix] * 2; | peaks[ix].bw1 = fr1->bw[ix] * 2; | ||||
peaks[ix].bw = int(peaks[ix].bw1); | peaks[ix].bw = (int)peaks[ix].bw1; | ||||
next = fr2->bw[ix] * 2; | next = fr2->bw[ix] * 2; | ||||
peaks[ix].bw_inc = ((next - peaks[ix].bw1) * STEPSIZE) / length; | peaks[ix].bw_inc = ((next - peaks[ix].bw1) * STEPSIZE) / length; | ||||
} | } | ||||
if(peaks[0].freq1 == 0) | if(peaks[0].freq1 == 0) | ||||
peaks[0].freq1 = kt_frame.Fhz[F_NP]; // if no nasal zero, set it to same freq as nasal pole | peaks[0].freq1 = kt_frame.Fhz[F_NP]; // if no nasal zero, set it to same freq as nasal pole | ||||
peaks[0].freq = int(peaks[0].freq1); | peaks[0].freq = (int)peaks[0].freq1; | ||||
next = fr2->klattp[KLATT_FNZ] * 2; | next = fr2->klattp[KLATT_FNZ] * 2; | ||||
if(next == 0) | if(next == 0) | ||||
next = kt_frame.Fhz[F_NP]; | next = kt_frame.Fhz[F_NP]; | ||||
for(ix=1; ix < 7; ix++) | for(ix=1; ix < 7; ix++) | ||||
{ | { | ||||
peaks[ix].bp1 = fr1->klatt_bp[ix] * 4; // parallel bandwidth | peaks[ix].bp1 = fr1->klatt_bp[ix] * 4; // parallel bandwidth | ||||
peaks[ix].bp = int(peaks[ix].bp1); | peaks[ix].bp = (int)peaks[ix].bp1; | ||||
next = fr2->klatt_bp[ix] * 2; | next = fr2->klatt_bp[ix] * 2; | ||||
peaks[ix].bp_inc = ((next - peaks[ix].bp1) * STEPSIZE) / length; | peaks[ix].bp_inc = ((next - peaks[ix].bp1) * STEPSIZE) / length; | ||||
peaks[ix].ap1 = fr1->klatt_ap[ix]; // parallal amplitude | peaks[ix].ap1 = fr1->klatt_ap[ix]; // parallal amplitude | ||||
peaks[ix].ap = int(peaks[ix].ap1); | peaks[ix].ap = (int)peaks[ix].ap1; | ||||
next = fr2->klatt_ap[ix] * 2; | next = fr2->klatt_ap[ix] * 2; | ||||
peaks[ix].ap_inc = ((next - peaks[ix].ap1) * STEPSIZE) / length; | peaks[ix].ap_inc = ((next - peaks[ix].ap1) * STEPSIZE) / length; | ||||
} | } |
void SpeakFile(void); | void SpeakFile(void); | ||||
void ReadVoice(int variant); | void ReadVoice(int variant); | ||||
void OnCommand(wxCommandEvent& event); | void OnCommand(wxCommandEvent& event); | ||||
wxTextCtrl* t_source; | |||||
private: | private: | ||||
wxButton *t_translate; | wxButton *t_translate; | ||||
wxButton *t_process; | wxButton *t_process; | ||||
wxTextCtrl* t_source; | |||||
wxTextCtrl* t_phonetic; | wxTextCtrl* t_phonetic; | ||||
MENU_DOCS, | MENU_DOCS, | ||||
MENU_OPTIONS, | MENU_OPTIONS, | ||||
MENU_PARAMS, | MENU_OPT_SPEED, | ||||
MENU_OPT_PUNCT, | |||||
MENU_OPT_SPELL, | |||||
MENU_PATHS, | MENU_PATHS, | ||||
MENU_PATH0, | MENU_PATH0, | ||||
MENU_PATH1, | MENU_PATH1, | ||||
MENU_SPEAK_TRANSLATE, | MENU_SPEAK_TRANSLATE, | ||||
MENU_SPEAK_RULES, | MENU_SPEAK_RULES, | ||||
MENU_SPEAK_IPA, | |||||
MENU_SPEAK_TEXT, | MENU_SPEAK_TEXT, | ||||
MENU_SPEAK_FILE, | MENU_SPEAK_FILE, | ||||
MENU_SPEAK_PAUSE, | MENU_SPEAK_PAUSE, |
va_end(params); | va_end(params); | ||||
} | } | ||||
static void err(const char *err, ...) | static void err(const char *errmsg, ...) | ||||
{ | { | ||||
va_list params; | va_list params; | ||||
va_start(params, err); | va_start(params, errmsg); | ||||
vsnprintf(mbr_errorbuf, sizeof(mbr_errorbuf), err, params); | vsnprintf(mbr_errorbuf, sizeof(mbr_errorbuf), errmsg, params); | ||||
va_end(params); | va_end(params); | ||||
log("mbrola error: \"%s\"", mbr_errorbuf); | log("mbrowrap error: %s", mbr_errorbuf); | ||||
} | } | ||||
static int create_pipes(int p1[2], int p2[2], int p3[2]) | static int create_pipes(int p1[2], int p2[2], int p3[2]) | ||||
{ | { | ||||
int error=0; | int error; | ||||
if (pipe(p1) != -1) { | if (pipe(p1) != -1) { | ||||
if (pipe(p2) != -1) { | if (pipe(p2) != -1) { | ||||
error = errno; | error = errno; | ||||
close(p1[0]); | close(p1[0]); | ||||
close(p1[1]); | close(p1[1]); | ||||
} | } else | ||||
error = errno; | |||||
err("pipe(): %s", strerror(error)); | err("pipe(): %s", strerror(error)); | ||||
return -1; | return -1; | ||||
mbr_pending_data_tail = NULL; | mbr_pending_data_tail = NULL; | ||||
} | } | ||||
static int mbrola_has_errors(void) | static int mbrola_died(void) | ||||
{ | { | ||||
int result, error; | pid_t pid; | ||||
int status, len; | |||||
const char *msg; | |||||
char msgbuf[80]; | |||||
pid = waitpid(mbr_pid, &status, WNOHANG); | |||||
if (!pid) { | |||||
msg = "mbrola closed stderr and did not exit"; | |||||
} else if (pid != mbr_pid) { | |||||
msg = "waitpid() is confused"; | |||||
} else { | |||||
mbr_pid = 0; | |||||
if (WIFSIGNALED(status)) { | |||||
int sig = WTERMSIG(status); | |||||
snprintf(msgbuf, sizeof(msgbuf), | |||||
"mbrola died by signal %d", sig); | |||||
msg = msgbuf; | |||||
} else if (WIFEXITED(status)) { | |||||
int exst = WEXITSTATUS(status); | |||||
snprintf(msgbuf, sizeof(msgbuf), | |||||
"mbrola exited with status %d", exst); | |||||
msg = msgbuf; | |||||
} else { | |||||
msg = "mbrola died and wait status is weird"; | |||||
} | |||||
} | |||||
result = read(mbr_error_fd, mbr_errorbuf, sizeof(mbr_errorbuf)-1); | log("mbrowrap error: %s", msg); | ||||
if (result == -1) { | len = strlen(mbr_errorbuf); | ||||
if (errno == EAGAIN) | if (!len) | ||||
return 0; | snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), "%s", msg); | ||||
err("read(error): %s", strerror(errno)); | else | ||||
return -1; | snprintf(mbr_errorbuf + len, sizeof(mbr_errorbuf) - len, | ||||
} | ", (%s)", msg); | ||||
return -1; | |||||
} | |||||
static int mbrola_has_errors(void) | |||||
{ | |||||
int result; | |||||
char buffer[256]; | |||||
char *buf_ptr, *lf; | |||||
buf_ptr = buffer; | |||||
for (;;) { | |||||
result = read(mbr_error_fd, buf_ptr, | |||||
sizeof(buffer) - (buf_ptr - buffer) - 1); | |||||
if (result == -1) { | |||||
if (errno == EAGAIN) | |||||
return 0; | |||||
err("read(error): %s", strerror(errno)); | |||||
return -1; | |||||
} | |||||
if (result != 0) { | if (result == 0) { | ||||
mbr_errorbuf[result] = 0; | /* EOF on stderr, assume mbrola died. */ | ||||
if (mbr_errorbuf[result - 1] == '\n') | return mbrola_died(); | ||||
mbr_errorbuf[result - 1] = 0; | |||||
/* inhibit the reset signal message */ | |||||
if (strncmp(mbr_errorbuf, "Got a reset signal", 18) == 0) { | |||||
mbr_errorbuf[0] = 0; | |||||
return 0; | |||||
} | } | ||||
/* don't consider this fatal at this point */ | buf_ptr[result] = 0; | ||||
error = 0; | for (; (lf = strchr(buf_ptr, '\n')); buf_ptr = lf + 1) { | ||||
} else { | /* inhibit the reset signal messages */ | ||||
/* EOF on stderr, assume mbrola died. */ | if (strncmp(buf_ptr, "Got a reset signal", 18) == 0 || | ||||
pid_t pid; | strncmp(buf_ptr, "Input Flush Signal", 18) == 0) | ||||
int status, len; | continue; | ||||
const char *msg; | *lf = 0; | ||||
char msgbuf[80]; | log("mbrola: %s", buf_ptr); | ||||
/* is this the last line? */ | |||||
pid = waitpid(mbr_pid, &status, WNOHANG); | if (lf == &buf_ptr[result - 1]) { | ||||
if (!pid) { | snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), | ||||
msg = "mbrola closed stderr and did not exit"; | "%s", buf_ptr); | ||||
} else { | /* don't consider this fatal at this point */ | ||||
mbr_pid = 0; | return 0; | ||||
if (WIFSIGNALED(status)) { | |||||
int sig = WTERMSIG(status); | |||||
snprintf(msgbuf, sizeof(msgbuf), | |||||
"mbrola died by signal %d", sig); | |||||
msg = msgbuf; | |||||
} else if (WIFEXITED(status)) { | |||||
int exst = WEXITSTATUS(status); | |||||
snprintf(msgbuf, sizeof(msgbuf), | |||||
"mbrola exited with status %d", exst); | |||||
msg = msgbuf; | |||||
} else { | |||||
msg = "mbrola died and wait status is weird"; | |||||
} | } | ||||
} | } | ||||
len = strlen(mbr_errorbuf); | |||||
if (!len) | |||||
snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), "%s", msg); | |||||
else | |||||
snprintf(mbr_errorbuf+len, sizeof(mbr_errorbuf)-len, | |||||
", (%s)", msg); | |||||
error = -1; | |||||
} | |||||
log("mbrola error: \"%s\"", mbr_errorbuf); | memmove(buffer, buf_ptr, result); | ||||
return error; | buf_ptr = buffer + result; | ||||
} | |||||
} | } | ||||
static int send_to_mbrola(const char *cmd) | static int send_to_mbrola(const char *cmd) | ||||
/* we should actually be getting only 44 bytes */ | /* we should actually be getting only 44 bytes */ | ||||
result = receive_from_mbrola(wavhdr, 45); | result = receive_from_mbrola(wavhdr, 45); | ||||
if (result != 44) { | if (result != 44) { | ||||
err("unable to get .wav header from mbrola"); | if (result >= 0) | ||||
err("unable to get .wav header from mbrola"); | |||||
stop_mbrola(); | stop_mbrola(); | ||||
return -1; | return -1; | ||||
} | } | ||||
} | } | ||||
mbr_samplerate = wavhdr[24] + (wavhdr[25]<<8) + | mbr_samplerate = wavhdr[24] + (wavhdr[25]<<8) + | ||||
(wavhdr[26]<<16) + (wavhdr[27]<<24); | (wavhdr[26]<<16) + (wavhdr[27]<<24); | ||||
//log("mbrola: voice samplerate = %d", mbr_samplerate); | //log("mbrowrap: voice samplerate = %d", mbr_samplerate); | ||||
/* remember the voice path for setVolumeRatio_MBR() */ | /* remember the voice path for setVolumeRatio_MBR() */ | ||||
if (mbr_voice_path != voice_path) { | if (mbr_voice_path != voice_path) { | ||||
int lastErrorStr_MBR(char *buffer, int bufsize) | int lastErrorStr_MBR(char *buffer, int bufsize) | ||||
{ | { | ||||
int result = snprintf(buffer, bufsize, "%s", mbr_errorbuf); | int result; | ||||
if (mbr_pid) | |||||
mbrola_has_errors(); | |||||
result = snprintf(buffer, bufsize, "%s", mbr_errorbuf); | |||||
return result >= bufsize ? (bufsize - 1) : result; | return result >= bufsize ? (bufsize - 1) : result; | ||||
} | } | ||||
speak_menu = new wxMenu; | speak_menu = new wxMenu; | ||||
speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate")); | speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate")); | ||||
speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules")); | speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules")); | ||||
speak_menu->Append(MENU_SPEAK_IPA, _("Show &IPA")); | |||||
speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak")); | speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak")); | ||||
speak_menu->AppendSeparator(); | speak_menu->AppendSeparator(); | ||||
speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file...")); | speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file...")); | ||||
option_menu = new wxMenu; | option_menu = new wxMenu; | ||||
option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu); | option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu); | ||||
option_menu->Append(MENU_PARAMS, _("Speed...")); | option_menu->Append(MENU_OPT_SPEED, _("Speed...")); | ||||
option_menu->Append(MENU_OPT_PUNCT, _("Speak punctiation")); | |||||
option_menu->Append(MENU_OPT_SPELL, _("Speak character names")); | |||||
// TOOLS | // TOOLS | ||||
vowelchart_menu = new wxMenu; | vowelchart_menu = new wxMenu; |
void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_buf1) | void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_buf1, int control) | ||||
{//================================================================================= | {//============================================================================================== | ||||
// control, bit 0: not the first letter of a word | |||||
int len; | int len; | ||||
unsigned char *p; | |||||
static char single_letter[10] = {0,0}; | static char single_letter[10] = {0,0}; | ||||
char ph_stress[2]; | |||||
unsigned int dict_flags[2]; | unsigned int dict_flags[2]; | ||||
char ph_buf3[40]; | char ph_buf3[40]; | ||||
char *ptr; | char *ptr; | ||||
LookupAccentedLetter(tr, letter, ph_buf3); | LookupAccentedLetter(tr, letter, ph_buf3); | ||||
} | } | ||||
if(ph_buf3[0] == 0) | strcpy(ph_buf1, ph_buf3); | ||||
{ | if((ph_buf1[0] == 0) || (ph_buf1[0] == phonSWITCH)) | ||||
ph_buf1[0] = 0; | |||||
return; | |||||
} | |||||
if(ph_buf3[0] == phonSWITCH) | |||||
{ | { | ||||
strcpy(ph_buf1,ph_buf3); | |||||
return; | return; | ||||
} | } | ||||
// at a stress marker at the start of the letter name, unless one is already marked | |||||
ph_stress[0] = phonSTRESS_P; | |||||
ph_stress[1] = 0; | |||||
for(p=(unsigned char *)ph_buf3; (*p != 0) && (phoneme_tab[*p] != NULL); p++) | dict_flags[0] = 0; | ||||
{ | dict_flags[1] = 0; | ||||
if(phoneme_tab[*p]->type == phSTRESS) | SetWordStress(tr, ph_buf1, dict_flags, -1, control & 1); | ||||
ph_stress[0] = 0; // stress is already marked | } // end of LookupLetter | ||||
} | |||||
sprintf(ph_buf1,"%s%s",ph_stress,ph_buf3); | |||||
} | |||||
{//========================================================================= | {//========================================================================= | ||||
// get pronunciation for an isolated letter | // get pronunciation for an isolated letter | ||||
// return number of bytes used by the letter | // return number of bytes used by the letter | ||||
// control 2=say-as glyphs, 3-say-as chars | // control bit 0: a non-initial letter in a word | ||||
// bit 1: say 'capital' | |||||
int n_bytes; | int n_bytes; | ||||
int letter; | int letter; | ||||
int len; | int len; | ||||
letter &= 0xff; // uncode private usage area | letter &= 0xff; // uncode private usage area | ||||
} | } | ||||
if(control > 2) | if(control & 2) | ||||
{ | { | ||||
// include CAPITAL information | // include CAPITAL information | ||||
if(iswupper(letter)) | if(iswupper(letter)) | ||||
} | } | ||||
letter = towlower2(letter); | letter = towlower2(letter); | ||||
LookupLetter(tr, letter, word[n_bytes], ph_buf); | LookupLetter(tr, letter, word[n_bytes], ph_buf, control & 1); | ||||
if(ph_buf[0] == phonSWITCH) | if(ph_buf[0] == phonSWITCH) | ||||
{ | { | ||||
SetTranslator2("en"); | SetTranslator2("en"); | ||||
save_option_phonemes = option_phonemes; | save_option_phonemes = option_phonemes; | ||||
option_phonemes = 0; | option_phonemes = 0; | ||||
LookupLetter(translator2, letter, word[n_bytes], ph_buf); | LookupLetter(translator2, letter, word[n_bytes], ph_buf, control & 1); | ||||
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | ||||
option_phonemes = save_option_phonemes; | option_phonemes = save_option_phonemes; | ||||
{ | { | ||||
pbuf += strlen(pbuf); | pbuf += strlen(pbuf); | ||||
*pbuf++ = phonPAUSE_VSHORT; | *pbuf++ = phonPAUSE_VSHORT; | ||||
LookupLetter(tr, *p2, 0, pbuf); | LookupLetter(tr, *p2, 0, pbuf, 1); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if(control == 4) | if(control == 4) | ||||
c = phonPAUSE; // pause after each character | c = phonPAUSE; // pause after each character | ||||
if(((count % 3) == 0) || (control > 2)) | if(((count % 3) == 0) || (control > 2)) | ||||
c = phonPAUSE_SHORT; // pause following a primary stress | c = phonPAUSE_NOLINK; // pause following a primary stress | ||||
else | else | ||||
continue; // remove marker | c = phonPAUSE_VSHORT; | ||||
// else | |||||
// continue; // remove marker | |||||
} | } | ||||
*phonemes++ = c; | *phonemes++ = c; | ||||
} | } | ||||
hyphen = 1; | hyphen = 1; | ||||
ix++; | ix++; | ||||
} | } | ||||
while((word[ix] != 0) && (word[ix] != ' ') && (ix < int(sizeof(suffix)-1))) | while((word[ix] != 0) && (word[ix] != ' ') && (ix < (int)(sizeof(suffix)-1))) | ||||
{ | { | ||||
*p++ = word[ix++]; | *p++ = word[ix++]; | ||||
} | } |
{ | { | ||||
// the envelope is given by a Tone phoneme acting on this vowel | // the envelope is given by a Tone phoneme acting on this vowel | ||||
InterpretPhoneme2(ph->tone_ph, &phdata_tone); | InterpretPhoneme2(ph->tone_ph, &phdata_tone); | ||||
env = LookupEnvelope(phdata_tone.pitch_env); | env = GetEnvelope(phdata_tone.pitch_env); | ||||
} | } | ||||
if(env == NULL) | |||||
return; | |||||
for(ix=0; ix<=width; ix+=4) | for(ix=0; ix<=width; ix+=4) | ||||
{ | { | ||||
x = int((ix * 127.9)/width); | x = int((ix * 127.9)/width); |
CLAUSE_COMMA, CLAUSE_PERIOD, CLAUSE_QUESTION, CLAUSE_EXCLAMATION, CLAUSE_COLON, CLAUSE_SEMICOLON, | CLAUSE_COMMA, CLAUSE_PERIOD, CLAUSE_QUESTION, CLAUSE_EXCLAMATION, CLAUSE_COLON, CLAUSE_SEMICOLON, | ||||
CLAUSE_SEMICOLON, // en-dash | CLAUSE_SEMICOLON, // en-dash | ||||
CLAUSE_SEMICOLON, // em-dash | CLAUSE_SEMICOLON, // em-dash | ||||
CLAUSE_SEMICOLON + PUNCT_SAY_NAME | 0x8000, // elipsis | CLAUSE_SEMICOLON | PUNCT_SAY_NAME | 0x8000, // elipsis | ||||
CLAUSE_QUESTION, // Greek question mark | CLAUSE_QUESTION, // Greek question mark | ||||
CLAUSE_SEMICOLON, // Greek semicolon | CLAUSE_SEMICOLON, // Greek semicolon | ||||
CLAUSE_PERIOD+0x8000, // Devanagari Danda (fullstop) | CLAUSE_PERIOD | 0x8000, // Devanagari Danda (fullstop) | ||||
CLAUSE_PERIOD+0x8000, // Armenian period | CLAUSE_PERIOD | 0x8000, // Armenian period | ||||
CLAUSE_COMMA, // Armenian comma | CLAUSE_COMMA, // Armenian comma | ||||
CLAUSE_EXCLAMATION + PUNCT_IN_WORD, // Armenian exclamation | CLAUSE_EXCLAMATION | PUNCT_IN_WORD, // Armenian exclamation | ||||
CLAUSE_QUESTION + PUNCT_IN_WORD, // Armenian question | CLAUSE_QUESTION | PUNCT_IN_WORD, // Armenian question | ||||
CLAUSE_PERIOD + PUNCT_IN_WORD, // Armenian emphasis mark | CLAUSE_PERIOD | PUNCT_IN_WORD, // Armenian emphasis mark | ||||
CLAUSE_SEMICOLON, // Arabic ; | CLAUSE_SEMICOLON, // Arabic ; | ||||
CLAUSE_QUESTION, // Arabic question mark | CLAUSE_QUESTION, // Arabic question mark |
static void DoEmbedded2(int &embix) | static void DoEmbedded2(int *embix) | ||||
{//================================ | {//================================ | ||||
// There were embedded commands in the text at this point | // There were embedded commands in the text at this point | ||||
unsigned int word; | unsigned int word; | ||||
do { | do { | ||||
word = embedded_list[embix++]; | word = embedded_list[(*embix)++]; | ||||
if((word & 0x1f) == EMBED_S) | if((word & 0x1f) == EMBED_S) | ||||
{ | { | ||||
if(p->synthflags & SFLAG_EMBEDDED) | if(p->synthflags & SFLAG_EMBEDDED) | ||||
{ | { | ||||
DoEmbedded2(embedded_ix); | DoEmbedded2(&embedded_ix); | ||||
} | } | ||||
type = p->type; | type = p->type; | ||||
} | } | ||||
p->length = length_mod; | p->length = length_mod; | ||||
if(p->env >= (N_ENVELOPE_DATA-1)) | |||||
{ | |||||
fprintf(stderr,"espeak: Bad intonation data\n"); | |||||
p->env = 0; | |||||
} | |||||
// pre-vocalic part | // pre-vocalic part | ||||
// set last-pitch | // set last-pitch | ||||
env2 = p->env + 1; // version for use with preceding semi-vowel | env2 = p->env + 1; // version for use with preceding semi-vowel | ||||
if(p->tone_ph != 0) | if(p->tone_ph != 0) | ||||
{ | { | ||||
InterpretPhoneme2(p->tone_ph, &phdata_tone); | InterpretPhoneme2(p->tone_ph, &phdata_tone); | ||||
pitch_env = LookupEnvelope(phdata_tone.pitch_env); | pitch_env = GetEnvelope(phdata_tone.pitch_env); | ||||
} | } | ||||
else | else | ||||
{ | { |
"\t Amplitude, 0 to 200, default is 100\n" | "\t Amplitude, 0 to 200, default is 100\n" | ||||
"-g <integer>\n" | "-g <integer>\n" | ||||
"\t Word gap. Pause between words, units of 10mS at the default speed\n" | "\t Word gap. Pause between words, units of 10mS at the default speed\n" | ||||
"-k <integer>\n" | |||||
"\t Indicate capital letters with: 1=sound, 2=the word \"capitals\",\n" | |||||
"\t higher values indicate a pitch increase (try -k20).\n" | |||||
"-l <integer>\n" | "-l <integer>\n" | ||||
"\t Line length. If not zero (which is the default), consider\n" | "\t Line length. If not zero (which is the default), consider\n" | ||||
"\t lines less than this length as end-of-clause\n" | "\t lines less than this length as end-of-clause\n" | ||||
"-p <integer>\n" | "-p <integer>\n" | ||||
"\t Pitch adjustment, 0 to 99, default is 50\n" | "\t Pitch adjustment, 0 to 99, default is 50\n" | ||||
"-s <integer>\n" | "-s <integer>\n" | ||||
"\t Speed in words per minute 80 to 450, default is 175\n" | "\t Speed in words per minute, 80 to 450, default is 175\n" | ||||
"-v <voice name>\n" | "-v <voice name>\n" | ||||
"\t Use voice file of this name from espeak-data/voices\n" | "\t Use voice file of this name from espeak-data/voices\n" | ||||
"-w <wave file name>\n" | "-w <wave file name>\n" | ||||
"\t Write output to this WAV file, rather than speaking it directly\n" | "\t Write speech to this WAV file, rather than speaking it directly\n" | ||||
"-b\t Input text encoding, 1=UTF8, 2=8 bit, 4=16 bit \n" | "-b\t Input text encoding, 1=UTF8, 2=8 bit, 4=16 bit \n" | ||||
"-m\t Interpret SSML markup, and ignore other < > tags\n" | "-m\t Interpret SSML markup, and ignore other < > tags\n" | ||||
"-q\t Quiet, don't produce any speech (may be useful with -x)\n" | "-q\t Quiet, don't produce any speech (may be useful with -x)\n" | ||||
"-x\t Write phoneme mnemonics to stdout\n" | "-x\t Write phoneme mnemonics to stdout\n" | ||||
"-X\t Write phonemes mnemonics and translation trace to stdout\n" | "-X\t Write phonemes mnemonics and translation trace to stdout\n" | ||||
"-z\t No final sentence pause at the end of the text\n" | "-z\t No final sentence pause at the end of the text\n" | ||||
"--stdout Write speech output to stdout\n" | |||||
"--compile=<voice name>\n" | "--compile=<voice name>\n" | ||||
"\t Compile the pronunciation rules and dictionary in the current\n" | "\t Compile pronunciation rules and dictionary from the current\n" | ||||
"\t directory. <voice name> specifies the language\n" | "\t directory. <voice name> specifies the language\n" | ||||
"--ipa Write phonemes to stdout using International Phonetic Alphabet\n" | |||||
"--path=\"<path>\"\n" | "--path=\"<path>\"\n" | ||||
"\t Specifies the directory containing the espeak-data directory\n" | "\t Specifies the directory containing the espeak-data directory\n" | ||||
"--pho\n" | "--pho Write mbrola phoneme data (.pho) to stdout or to the file in --phonout\n" | ||||
"\t Write mbrola phoneme data (.pho) to stdout, or to the file in --phonout\n" | |||||
"--phonout=\"<filename>\"\n" | "--phonout=\"<filename>\"\n" | ||||
"\t Write phoneme output from -x -X and --pho to this file\n" | "\t Write phoneme output from -x -X --ipa and --pho to this file\n" | ||||
"--punct=\"<characters>\"\n" | "--punct=\"<characters>\"\n" | ||||
"\t Speak the names of punctuation characters during speaking. If\n" | "\t Speak the names of punctuation characters during speaking. If\n" | ||||
"\t =<characters> is omitted, all punctuation is spoken.\n" | "\t =<characters> is omitted, all punctuation is spoken.\n" | ||||
"--split=\"<minutes>\"\n" | "--split=\"<minutes>\"\n" | ||||
"\t Starts a new WAV file every <minutes>. Used with -w\n" | "\t Starts a new WAV file every <minutes>. Used with -w\n" | ||||
"--stdout Write speech output to stdout\n" | |||||
"--voices=<language>\n" | "--voices=<language>\n" | ||||
"\t List the available voices for the specified language.\n" | "\t List the available voices for the specified language.\n" | ||||
"\t If <language> is omitted, then list all voices.\n" | "\t If <language> is omitted, then list all voices.\n"; | ||||
"-k <integer>\n" | |||||
"\t Indicate capital letters with: 1=sound, 2=the word \"capitals\",\n" | |||||
"\t higher values indicate a pitch increase (try -k20).\n"; | |||||
void DisplayVoices(FILE *f_out, char *language); | void DisplayVoices(FILE *f_out, char *language); | ||||
{"path", required_argument, 0, 0x107}, | {"path", required_argument, 0, 0x107}, | ||||
{"phonout", required_argument, 0, 0x108}, | {"phonout", required_argument, 0, 0x108}, | ||||
{"pho", no_argument, 0, 0x109}, | {"pho", no_argument, 0, 0x109}, | ||||
{"ipa", no_argument, 0, 0x10a}, | |||||
{0, 0, 0, 0} | {0, 0, 0, 0} | ||||
}; | }; | ||||
break; | break; | ||||
case 0x109: // --pho | case 0x109: // --pho | ||||
option_mbrola_phonemes = 8; | option_mbrola_phonemes = 16; | ||||
break; | |||||
case 0x10a: // --ipa | |||||
option_phonemes = 3; | |||||
break; | break; | ||||
default: | default: |
{//============================================================ | {//============================================================ | ||||
ENTER("espeak_SetPhonemes"); | ENTER("espeak_SetPhonemes"); | ||||
/* Controls the output of phoneme symbols for the text | /* Controls the output of phoneme symbols for the text | ||||
value=0 No phoneme output (default) | bits 0-3: | ||||
value=1 Output the translated phoneme symbols for the text | value=0 No phoneme output (default) | ||||
value=2 as (1), but also output a trace of how the translation was done (matching rules and list entries) | value=1 Output the translated phoneme symbols for the text | ||||
bit 3: produce mbrola pho data | value=2 as (1), but also output a trace of how the translation was done (matching rules and list entries) | ||||
value=3 as (1), but produces IPA phoneme names rather than ascii | |||||
bit 4: produce mbrola pho data | |||||
*/ | */ | ||||
option_phonemes = value & 3; | option_phonemes = value & 3; | ||||
option_mbrola_phonemes = value & 8; | option_mbrola_phonemes = value & 16; | ||||
f_trans = stream; | f_trans = stream; | ||||
if(stream == NULL) | if(stream == NULL) | ||||
f_trans = stderr; | f_trans = stderr; |
value=0 No phoneme output (default) | value=0 No phoneme output (default) | ||||
value=1 Output the translated phoneme symbols for the text | value=1 Output the translated phoneme symbols for the text | ||||
value=2 as (1), but also output a trace of how the translation was done (matching rules and list entries) | value=2 as (1), but also output a trace of how the translation was done (matching rules and list entries) | ||||
value=3 as (1), but produces IPA rather than ascii phoneme names | |||||
stream output stream for the phoneme symbols (and trace). If stream=NULL then it uses stdout. | stream output stream for the phoneme symbols (and trace). If stream=NULL then it uses stdout. | ||||
*/ | */ |
int done; | int done; | ||||
int len_percent; | int len_percent; | ||||
const char *final_pitch; | const char *final_pitch; | ||||
char buf[80]; | char *ptr; | ||||
char mbr_buf[120]; | char mbr_buf[120]; | ||||
static int phix; | static int phix; | ||||
if (WcmdqFree() < MIN_WCMDQ) | if (WcmdqFree() < MIN_WCMDQ) | ||||
return 1; | return 1; | ||||
mbr_buf[0] = 0; | ptr = mbr_buf; | ||||
p = &plist[phix]; | p = &plist[phix]; | ||||
next = &plist[phix+1]; | next = &plist[phix+1]; | ||||
if(p->synthflags & SFLAG_EMBEDDED) | if(p->synthflags & SFLAG_EMBEDDED) | ||||
{ | { | ||||
DoEmbedded(embedded_ix, p->sourceix); | DoEmbedded(&embedded_ix, p->sourceix); | ||||
} | } | ||||
if(p->newword & 4) | if(p->newword & 4) | ||||
DoMarker(espeakEVENT_PHONEME, (p->sourceix & 0x7ff) + clause_start_char, 0, ph->mnemonic); | DoMarker(espeakEVENT_PHONEME, (p->sourceix & 0x7ff) + clause_start_char, 0, ph->mnemonic); | ||||
sprintf(buf,"%s\t",WordToString(name)); | ptr += sprintf(ptr,"%s\t",WordToString(name)); | ||||
strcat(mbr_buf,buf); | |||||
if(name2 == '_') | if(name2 == '_') | ||||
{ | { | ||||
// add a pause after this phoneme | // add a pause after this phoneme | ||||
pause = PauseLength(len_percent,0); | pause = len_percent; | ||||
name2 = 0; | name2 = 0; | ||||
} | } | ||||
if(name2 == 0) | if(name2 == 0) | ||||
{ | { | ||||
sprintf(buf,"%d\t%s", len, WritePitch(p->env,p->pitch1,p->pitch2,0,0)); | char *pitch = WritePitch(p->env,p->pitch1,p->pitch2,0,0); | ||||
strcat(mbr_buf,buf); | ptr += sprintf(ptr,"%d\t%s", len, pitch); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
char *pitch; | |||||
pitch = WritePitch(p->env,p->pitch1,p->pitch2,len_percent,0); | |||||
len1 = (len * len_percent)/100; | len1 = (len * len_percent)/100; | ||||
sprintf(buf,"%d\t%s", len1, WritePitch(p->env,p->pitch1,p->pitch2,len_percent,0)); | ptr += sprintf(ptr,"%d\t%s", len1, pitch); | ||||
strcat(mbr_buf,buf); | |||||
sprintf(buf,"%s\t%d\t%s", WordToString(name2), len-len1, WritePitch(p->env,p->pitch1,p->pitch2,-len_percent,0)); | pitch = WritePitch(p->env,p->pitch1,p->pitch2,-len_percent,0); | ||||
strcat(mbr_buf,buf); | ptr += sprintf(ptr,"%s\t%d\t%s", WordToString(name2), len-len1, pitch); | ||||
} | } | ||||
done = 1; | done = 1; | ||||
break; | break; | ||||
if(name2 != 0) | if(name2 != 0) | ||||
{ | { | ||||
len1 = (len * len_percent)/100; | len1 = (len * len_percent)/100; | ||||
sprintf(buf,"%d\n%s\t",len1,WordToString(name2)); | ptr += sprintf(ptr,"%d\n%s\t",len1,WordToString(name2)); | ||||
strcat(mbr_buf,buf); | |||||
len -= len1; | len -= len1; | ||||
} | } | ||||
sprintf(buf,"%d%s\n",len,final_pitch); | ptr += sprintf(ptr,"%d%s\n",len,final_pitch); | ||||
strcat(mbr_buf,buf); | |||||
} | } | ||||
if(pause) | if(pause) | ||||
{ | { | ||||
len += PauseLength(pause,0); | len += PauseLength(pause,0); | ||||
sprintf(buf,"_ \t%d\n",PauseLength(pause,0)); | ptr += sprintf(ptr,"_ \t%d\n",PauseLength(pause,0)); | ||||
strcat(mbr_buf,buf); | |||||
pause = 0; | pause = 0; | ||||
} | } | ||||
if(f_mbrola) | if(f_mbrola) | ||||
{ | { | ||||
fwrite(mbr_buf,1,strlen(mbr_buf),f_mbrola); // write .pho to a file | fwrite(mbr_buf,1,(ptr-mbr_buf),f_mbrola); // write .pho to a file | ||||
} | } | ||||
else | else | ||||
{ | { |
#include "translate.h" | #include "translate.h" | ||||
#include "wave.h" | #include "wave.h" | ||||
const char *version_string = "1.43.48 28.Jun.10"; | const char *version_string = "1.43.52 04.Jul.10"; | ||||
const int version_phdata = 0x014342; | const int version_phdata = 0x014351; | ||||
int option_device_number = -1; | int option_device_number = -1; | ||||
FILE *f_logespeak = NULL; | FILE *f_logespeak = NULL; | ||||
unsigned char *LookupEnvelope(int ix) | unsigned char *GetEnvelope(int index) | ||||
{//================================ | {//================================== | ||||
if(ix==0) | if(index==0) | ||||
return(NULL); | { | ||||
return((unsigned char *)&spects_data[ix]); | fprintf(stderr,"espeak: No envelope\n"); | ||||
return(envelope_data[0]); // not found, use a default envelope | |||||
} | |||||
return((unsigned char *)&spects_data[index]); | |||||
} | } | ||||
phdata->pd_param[i_APPEND_PHONEME] = data; | phdata->pd_param[i_APPEND_PHONEME] = data; | ||||
} | } | ||||
else | else | ||||
if(instn2 == i_IPA_NAME) | |||||
{ | |||||
// followed by utf-8 characters, 2 per instn word | |||||
for(ix=0; (ix < data) && (ix < 16); ix += 2) | |||||
{ | |||||
prog++; | |||||
phdata->ipa_string[ix] = prog[0] >> 8; | |||||
phdata->ipa_string[ix+1] = prog[0] & 0xff; | |||||
} | |||||
phdata->ipa_string[ix] = 0; | |||||
} | |||||
else | |||||
if(instn2 < N_PHONEME_DATA_PARAM) | if(instn2 < N_PHONEME_DATA_PARAM) | ||||
{ | { | ||||
if(instn2 == i_CHANGE_PHONEME2) | if(instn2 == i_CHANGE_PHONEME2) |
} | } | ||||
void DoEmbedded(int &embix, int sourceix) | void DoEmbedded(int *embix, int sourceix) | ||||
{//====================================== | {//====================================== | ||||
// There were embedded commands in the text at this point | // There were embedded commands in the text at this point | ||||
unsigned int word; // bit 7=last command for this word, bits 5,6 sign, bits 0-4 command | unsigned int word; // bit 7=last command for this word, bits 5,6 sign, bits 0-4 command | ||||
int command; | int command; | ||||
do { | do { | ||||
word = embedded_list[embix++]; | word = embedded_list[(*embix)++]; | ||||
value = word >> 8; | value = word >> 8; | ||||
command = word & 0x7f; | command = word & 0x7f; | ||||
if(p->synthflags & SFLAG_EMBEDDED) | if(p->synthflags & SFLAG_EMBEDDED) | ||||
{ | { | ||||
DoEmbedded(embedded_ix, p->sourceix); | DoEmbedded(&embedded_ix, p->sourceix); | ||||
} | } | ||||
if(p->newword) | if(p->newword) | ||||
if(p->tone_ph != 0) | if(p->tone_ph != 0) | ||||
{ | { | ||||
InterpretPhoneme2(p->tone_ph, &phdata_tone); | InterpretPhoneme2(p->tone_ph, &phdata_tone); | ||||
pitch_env = LookupEnvelope(phdata_tone.pitch_env); | pitch_env = GetEnvelope(phdata_tone.pitch_env); | ||||
amp_env = LookupEnvelope(phdata_tone.amp_env); | amp_env = GetEnvelope(phdata_tone.amp_env); | ||||
} | } | ||||
StartSyllable(); | StartSyllable(); | ||||
CalcPitches(translator, clause_tone); | CalcPitches(translator, clause_tone); | ||||
CalcLengths(translator); | CalcLengths(translator); | ||||
GetTranslatedPhonemeString(translator->phon_out,sizeof(translator->phon_out)); | if((option_phonemes > 0) || (phoneme_callback != NULL)) | ||||
if(option_phonemes > 0) | |||||
{ | { | ||||
fprintf(f_trans,"%s\n",translator->phon_out); | GetTranslatedPhonemeString(translator->phon_out,sizeof(translator->phon_out)); | ||||
if(option_phonemes > 0) | |||||
if(!iswalpha(0x010d)) | { | ||||
fprintf(f_trans,"%s\n",translator->phon_out); | |||||
if(!iswalpha(0x010d)) | |||||
{ | |||||
// check that c-caron is recognized as an alphabetic character | |||||
fprintf(stderr,"Warning: Accented letters are not recognized, eg: U+010D\nSet LC_CTYPE to a UTF-8 locale\n"); | |||||
} | |||||
} | |||||
if(phoneme_callback != NULL) | |||||
{ | { | ||||
// check that c-caron is recognized as an alphabetic character | phoneme_callback(translator->phon_out); | ||||
fprintf(stderr,"Warning: Accented letters are not recognized, eg: U+010D\nSet LC_CTYPE to a UTF-8 locale\n"); | |||||
} | } | ||||
} | } | ||||
if(phoneme_callback != NULL) | |||||
{ | |||||
phoneme_callback(translator->phon_out); | |||||
} | |||||
if(skipping_text) | if(skipping_text) |
int vowel_transition[4]; | int vowel_transition[4]; | ||||
int pitch_env; | int pitch_env; | ||||
int amp_env; | int amp_env; | ||||
char ipa_string[18]; | |||||
} PHONEME_DATA; | } PHONEME_DATA; | ||||
#define i_RETURN 0x0001 | #define i_RETURN 0x0001 | ||||
#define i_CONTINUE 0x0002 | #define i_CONTINUE 0x0002 | ||||
// Group 0 instrcutions with 8 bit operand. These value go into bits 8-15 if the instruction | // Group 0 instrcutions with 8 bit operand. These values go into bits 8-15 of the instruction | ||||
#define i_CHANGE_PHONEME 0x01 | #define i_CHANGE_PHONEME 0x01 | ||||
#define i_REPLACE_NEXT_PHONEME 0x02 | #define i_REPLACE_NEXT_PHONEME 0x02 | ||||
#define i_INSERT_PHONEME 0x03 | #define i_INSERT_PHONEME 0x03 | ||||
#define i_SET_LENGTH 0x0a | #define i_SET_LENGTH 0x0a | ||||
#define i_LONG_LENGTH 0x0b | #define i_LONG_LENGTH 0x0b | ||||
#define i_CHANGE_PHONEME2 0x0c // not yet used | #define i_CHANGE_PHONEME2 0x0c // not yet used | ||||
#define i_IPA_NAME 0x0d | |||||
#define i_CHANGE_IF 0x10 // 0x10 to 0x14 | #define i_CHANGE_IF 0x10 // 0x10 to 0x14 | ||||
#define i_ADD_LENGTH 0x0c | #define i_ADD_LENGTH 0x0c | ||||
#define ENV_LEN 128 // length of pitch envelopes | #define ENV_LEN 128 // length of pitch envelopes | ||||
#define PITCHfall 0 // standard pitch envelopes | #define PITCHfall 0 // standard pitch envelopes | ||||
#define PITCHrise 2 | #define PITCHrise 2 | ||||
extern unsigned char *envelope_data[20]; | #define N_ENVELOPE_DATA 20 | ||||
extern unsigned char *envelope_data[N_ENVELOPE_DATA]; | |||||
extern int formant_rate[]; // max rate of change of each formant | extern int formant_rate[]; // max rate of change of each formant | ||||
extern SPEED_FACTORS speed; | extern SPEED_FACTORS speed; | ||||
int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, int resume); | int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, int resume); | ||||
int MbrolaFill(int length, int resume); | int MbrolaFill(int length, int resume); | ||||
void MbrolaReset(void); | void MbrolaReset(void); | ||||
void DoEmbedded(int &embix, int sourceix); | void DoEmbedded(int *embix, int sourceix); | ||||
void DoMarker(int type, int char_posn, int length, int value); | void DoMarker(int type, int char_posn, int length, int value); | ||||
//int DoSample(PHONEME_TAB *ph1, PHONEME_TAB *ph2, int which, int length_mod, int amp); | //int DoSample(PHONEME_TAB *ph1, PHONEME_TAB *ph2, int which, int length_mod, int amp); | ||||
int DoSample3(PHONEME_DATA *phdata, int length_mod, int amp); | int DoSample3(PHONEME_DATA *phdata, int length_mod, int amp); | ||||
int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_LIST *plist, int modulation); | int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_LIST *plist, int modulation); | ||||
int PauseLength(int pause, int control); | int PauseLength(int pause, int control); | ||||
int LookupPhonemeTable(const char *name); | int LookupPhonemeTable(const char *name); | ||||
unsigned char *GetEnvelope(int index); | |||||
void InitBreath(void); | void InitBreath(void); | ||||
case L('d','a'): // Danish | case L('d','a'): // Danish | ||||
{ | { | ||||
static const short stress_lengths_da[8] = {160,140, 200,200, 0,0, 220,210}; | static const short stress_lengths_da[8] = {160,140, 200,200, 0,0, 220,230}; | ||||
SetupTranslator(tr,stress_lengths_da,NULL); | SetupTranslator(tr,stress_lengths_da,NULL); | ||||
tr->transpose_min = 'a'; | tr->transpose_min = 'a'; | ||||
} | } | ||||
break; | break; | ||||
case L('f','r'): // french | case L('f','r'): // french | ||||
{ | { | ||||
static const short stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 235, 240}; | static const short stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 190, 240}; | ||||
static const unsigned char stress_amps_fr[8] = {18,16, 20,20, 20,22, 22,21 }; | static const unsigned char stress_amps_fr[8] = {18,16, 20,20, 20,22, 18,18 }; | ||||
SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); | SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); | ||||
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable | tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable | ||||
tr->langopts.stress_flags = 0x0024; // 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.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable | |||||
tr->langopts.accents = 2; // Say "Capital" after the letter. | |||||
tr->langopts.vowel_pause = 0; | |||||
tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL | NUM_DFRACTION_4; | tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL | NUM_DFRACTION_4; | ||||
SetLetterVowel(tr,'y'); | SetLetterVowel(tr,'y'); | ||||
break; | break; | ||||
case L('h','t'): // Haitian Creole | |||||
// static const short stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 235, 240}; | |||||
// memcpy(tr->stress_lengths,stress_lengths_fr,sizeof(tr->stress_lengths)); | |||||
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable | |||||
tr->langopts.stress_flags = 0x0024; // don't use secondary stress | |||||
tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL | NUM_DFRACTION_4; | |||||
break; | |||||
case L('h','u'): // Hungarian | case L('h','u'): // Hungarian | ||||
{ | { | ||||
static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,22, 22,21 }; | static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,22, 22,21 }; |
static char *SpeakIndividualLetters(Translator *tr, char *word, char *phonemes, int spell_word) | static char *SpeakIndividualLetters(Translator *tr, char *word, char *phonemes, int spell_word) | ||||
{//============================================================================================ | {//============================================================================================ | ||||
int posn = 0; | int posn = 0; | ||||
int capitals = 0; | |||||
int non_initial = 0; | |||||
if (spell_word > 2) | |||||
capitals = 2; | |||||
while((*word != ' ') && (*word != 0)) | while((*word != ' ') && (*word != 0)) | ||||
{ | { | ||||
word += TranslateLetter(tr, word, phonemes, spell_word); | word += TranslateLetter(tr, word, phonemes, capitals | non_initial); | ||||
posn++; | posn++; | ||||
non_initial = 1; | |||||
if(phonemes[0] == phonSWITCH) | if(phonemes[0] == phonSWITCH) | ||||
{ | { | ||||
// change to another language in order to translate this word | // change to another language in order to translate this word | ||||
{//=========================================================================== | {//=========================================================================== | ||||
// word1 is terminated by space (0x20) character | // word1 is terminated by space (0x20) character | ||||
int length; | |||||
int word_length; | int word_length; | ||||
int ix; | int ix; | ||||
int posn; | |||||
int pfix; | int pfix; | ||||
int n_chars; | int n_chars; | ||||
unsigned int dictionary_flags[2]; | unsigned int dictionary_flags[2]; | ||||
else | else | ||||
if(found == 0) | if(found == 0) | ||||
{ | { | ||||
int posn; | |||||
int non_initial; | |||||
int length; | |||||
// word's pronunciation is not given in the dictionary list, although | // word's pronunciation is not given in the dictionary list, although | ||||
// dictionary_flags may have ben set there | // dictionary_flags may have ben set there | ||||
posn = 0; | posn = 0; | ||||
non_initial = 0; | |||||
length = 999; | length = 999; | ||||
wordx = word1; | wordx = word1; | ||||
// This word looks "unpronouncable", so speak letters individually until we | // This word looks "unpronouncable", so speak letters individually until we | ||||
// find a remainder that we can pronounce. | // find a remainder that we can pronounce. | ||||
emphasize_allcaps = 0; | emphasize_allcaps = 0; | ||||
wordx += TranslateLetter(tr, wordx, unpron_phonemes, 0); | if(posn > 0) | ||||
non_initial = 1; | |||||
wordx += TranslateLetter(tr, wordx, unpron_phonemes, non_initial); | |||||
posn++; | posn++; | ||||
if(unpron_phonemes[0] == phonSWITCH) | if(unpron_phonemes[0] == phonSWITCH) | ||||
{ | { | ||||
snprintf(word_phonemes, sizeof(word_phonemes), "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); | snprintf(word_phonemes, sizeof(word_phonemes), "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); | ||||
#endif | #endif | ||||
word_phonemes[N_WORD_PHONEMES-1] = 0; | word_phonemes[N_WORD_PHONEMES-1] = 0; | ||||
SetWordStress(tr, word_phonemes, dictionary_flags, -1, tr->prev_last_stress); | SetWordStress(tr, word_phonemes, dictionary_flags, -1, 0); | ||||
} | } | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if(prefix_phonemes[0] == 0) | if(prefix_phonemes[0] == 0) | ||||
SetWordStress(tr, phonemes, dictionary_flags, -1, tr->prev_last_stress); | SetWordStress(tr, phonemes, dictionary_flags, -1, 0); | ||||
else | else | ||||
SetWordStress(tr, phonemes, dictionary_flags, -1, 0); | SetWordStress(tr, phonemes, dictionary_flags, -1, 0); | ||||
#ifdef PLATFORM_WINDOWS | #ifdef PLATFORM_WINDOWS | ||||
} | } | ||||
next_in_nbytes = utf8_in(&next_in,&source[source_index]); | next_in_nbytes = utf8_in(&next_in,&source[source_index]); | ||||
if(c == 0) | |||||
{ | |||||
finished = 1; | |||||
c = ' '; | |||||
} | |||||
if((c == CTRL_EMBEDDED) || (c == ctrl_embedded)) | if((c == CTRL_EMBEDDED) || (c == ctrl_embedded)) | ||||
{ | { | ||||
// start of embedded command in the text | // start of embedded command in the text | ||||
} | } | ||||
} | } | ||||
if(c == 0) | |||||
{ | |||||
finished = 1; | |||||
c = ' '; | |||||
} | |||||
else | |||||
if(IsAlpha(c)) | if(IsAlpha(c)) | ||||
{ | { | ||||
if(!IsAlpha(prev_out) || (tr->langopts.ideographs && ((c > 0x3040) || (prev_out > 0x3040)))) | if(!IsAlpha(prev_out) || (tr->langopts.ideographs && ((c > 0x3040) || (prev_out > 0x3040)))) |
#define NUM_SEP_SPACE 0x1000 // allow space as thousands separator (in addition to langopts.thousands_sep) | #define NUM_SEP_SPACE 0x1000 // allow space as thousands separator (in addition to langopts.thousands_sep) | ||||
#define NUM_DEC_IT 0x2000 // (LANG=it) speak post-decimal-point digits as a combined number not as single digits | #define NUM_DEC_IT 0x2000 // (LANG=it) speak post-decimal-point digits as a combined number not as single digits | ||||
struct Translator | typedef struct | ||||
{//============= | {//=========== | ||||
LANGUAGE_OPTIONS langopts; | LANGUAGE_OPTIONS langopts; | ||||
int translator_name; | int translator_name; | ||||
int end_stressed_vowel; // word ends with stressed vowel | int end_stressed_vowel; // word ends with stressed vowel | ||||
int prev_dict_flags; // dictionary flags from previous word | int prev_dict_flags; // dictionary flags from previous word | ||||
int clause_terminator; | int clause_terminator; | ||||
}; // end of class Translator | } Translator; | ||||
extern int option_tone2; | extern int option_tone2; | ||||
void ChangeWordStress(Translator *tr, char *word, int new_stress); | void ChangeWordStress(Translator *tr, char *word, int new_stress); | ||||
void SetSpellingStress(Translator *tr, char *phonemes, int control, int n_chars); | void SetSpellingStress(Translator *tr, char *phonemes, int control, int n_chars); | ||||
int TranslateLetter(Translator *tr, char *letter, char *phonemes, int control); | int TranslateLetter(Translator *tr, char *letter, char *phonemes, int control); | ||||
void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_buf); | void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_buf, int control); | ||||
void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf); | void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf); | ||||
int LoadDictionary(Translator *tr, const char *name, int no_error); | int LoadDictionary(Translator *tr, const char *name, int no_error); |
#define T_TRANSLATE 503 | #define T_TRANSLATE 503 | ||||
#define T_PROCESS 504 | #define T_PROCESS 504 | ||||
#define T_RULES 505 | #define T_RULES 505 | ||||
#define T_TRANSLATE_IPA 506 | |||||
TranslDlg *transldlg = NULL; | TranslDlg *transldlg = NULL; | ||||
extern char *speech_to_phonemes(char *data, char *phout); | extern char *speech_to_phonemes(char *data, char *phout); | ||||
EVT_BUTTON(T_TRANSLATE,TranslDlg::OnCommand) | EVT_BUTTON(T_TRANSLATE,TranslDlg::OnCommand) | ||||
EVT_BUTTON(T_PROCESS,TranslDlg::OnCommand) | EVT_BUTTON(T_PROCESS,TranslDlg::OnCommand) | ||||
EVT_BUTTON(T_RULES,TranslDlg::OnCommand) | EVT_BUTTON(T_RULES,TranslDlg::OnCommand) | ||||
EVT_BUTTON(T_TRANSLATE_IPA,TranslDlg::OnCommand) | |||||
END_EVENT_TABLE() | END_EVENT_TABLE() | ||||
FILE *f_wave = NULL; | FILE *f_wave = NULL; | ||||
wxFont font_phonetic; | |||||
wxTextAttr style_phonetic; | |||||
wxFont font_phonetic_large; | |||||
wxTextAttr style_phonetic_large; | |||||
#ifdef deleted | |||||
class IPATextCtrl : public wxTextCtrl | class IPATextCtrl : public wxTextCtrl | ||||
{ | { | ||||
public: | public: | ||||
END_EVENT_TABLE() | END_EVENT_TABLE() | ||||
// using Kirschenbaum scheme to enter IPA from the keyboard | |||||
wchar_t ipa1[256] = { | |||||
0,0x250,32,32,32,32,32,32,32,32,0xa,0xb,0xc,0x26f,0x272,0x275, | |||||
32,32,0x25a,32,32,32,32,0x28d,32,32,32,32,32,32,32,32, | |||||
0x20,0x21,0x22,0x23,0x24,0x25,0x0e6,0x27,0x28,0x27e,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, | |||||
0x252,0x31,0x32,0x25c,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x294, | |||||
0x259,0x251,0x3b2,0xe7,0xf0,0x25b,0x46,0x262,0x127,0x26a,0x25f,0x4b,0x26c,0x271,0x14b,0x254, | |||||
0x3a6,0x263,0x280,0x283,0x3b8,0x28a,0x28c,0x153,0x3c7,0xf8,0x292,0x32a,0x5c,0x5d,0x5e,0x5f, | |||||
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, | |||||
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x303,0x7f, | |||||
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, | |||||
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, | |||||
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, | |||||
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, | |||||
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, | |||||
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, | |||||
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, | |||||
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff | |||||
}; | |||||
IPATextCtrl::IPATextCtrl(wxWindow *parent,wxWindowID id,const wxPoint& pos,const wxSize& size) : | IPATextCtrl::IPATextCtrl(wxWindow *parent,wxWindowID id,const wxPoint& pos,const wxSize& size) : | ||||
wxTextCtrl(parent,id,_T(""),pos,size,wxTE_MULTILINE) | wxTextCtrl(parent,id,_T(""),pos,size,wxTE_MULTILINE) | ||||
{ | { | ||||
else | else | ||||
event.Skip(); | event.Skip(); | ||||
} | } | ||||
#endif | |||||
int height; | int height; | ||||
int width; | int width; | ||||
int x,y; | int x,y; | ||||
int font_size; | |||||
int height_ph = 350; | int height_ph = 350; | ||||
wxTextAttr attr; | wxTextAttr attr; | ||||
wxFont font = wxFont(12,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_LIGHT,false,_T(""),wxFONTENCODING_SYSTEM); | wxFont font = wxFont(12,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_LIGHT,false,_T(""),wxFONTENCODING_SYSTEM); | ||||
t_phonetic = new wxTextCtrl(this,T_PHONETIC,_T(""),wxPoint(0,262), | t_phonetic = new wxTextCtrl(this,T_PHONETIC,_T(""),wxPoint(0,262), | ||||
wxSize(298,height_ph),wxTE_MULTILINE | wxTE_READONLY,wxDefaultValidator,_T("Phoneme translation window")); | wxSize(298,height_ph),wxTE_MULTILINE | wxTE_READONLY,wxDefaultValidator,_T("Phoneme translation window")); | ||||
style_phonetic = t_phonetic->GetDefaultStyle(); | |||||
font_phonetic = style_phonetic.GetFont(); | |||||
font_size = font_phonetic.GetPointSize(); | |||||
font_phonetic_large = font_phonetic; | |||||
style_phonetic_large = style_phonetic; | |||||
font_phonetic_large.SetPointSize(font_size+1); | |||||
style_phonetic_large.SetFont(font_phonetic_large); | |||||
y = height_ph + 270; | y = height_ph + 270; | ||||
t_translate = new wxButton(this,T_TRANSLATE,_T("Translate"),wxPoint(4,y)); | t_translate = new wxButton(this,T_TRANSLATE,_T("Translate"),wxPoint(4,y)); | ||||
t_translate = new wxButton(this,T_RULES,_T("Show Rules"),wxPoint(4,y+32)); | t_translate = new wxButton(this,T_RULES,_T("Show Rules"),wxPoint(4,y+32)); | ||||
t_translate = new wxButton(this,T_TRANSLATE_IPA,_T("Show IPA"),wxPoint(100,y+32)); | |||||
t_process = new wxButton(this,T_PROCESS,_T("Speak"),wxPoint(100,y)); | t_process = new wxButton(this,T_PROCESS,_T("Speak"),wxPoint(100,y)); | ||||
t_source->SetFocus(); | t_source->SetFocus(); | ||||
#define N_PH_LIST N_PHONEME_LIST | #define N_PH_LIST N_PHONEME_LIST | ||||
void *vp; | void *vp; | ||||
int translate_text = 0; | |||||
char buf[1000]; | char buf[1000]; | ||||
char phon_out[N_PH_LIST*2]; | char phon_out[N_PH_LIST*2]; | ||||
int clause_tone; | int clause_tone; | ||||
{ | { | ||||
case T_RULES: | case T_RULES: | ||||
case MENU_SPEAK_RULES: | case MENU_SPEAK_RULES: | ||||
option_phonemes = 2; | |||||
#ifdef PLATFORM_POSIX | #ifdef PLATFORM_POSIX | ||||
strcpy(fname_temp,"/tmp/espeakXXXXXX"); | strcpy(fname_temp,"/tmp/espeakXXXXXX"); | ||||
if((fd_temp = mkstemp(fname_temp)) >= 0) | if((fd_temp = mkstemp(fname_temp)) >= 0) | ||||
f_trans = f; // write translation rule trace to a temp file | f_trans = f; // write translation rule trace to a temp file | ||||
} | } | ||||
#endif | #endif | ||||
t_phonetic->SetDefaultStyle(style_phonetic); | |||||
translate_text = 2; | |||||
break; | |||||
case T_TRANSLATE: | case T_TRANSLATE: | ||||
case MENU_SPEAK_TRANSLATE: | case MENU_SPEAK_TRANSLATE: | ||||
t_phonetic->SetDefaultStyle(style_phonetic); | |||||
translate_text = 1; | |||||
break; | |||||
case T_TRANSLATE_IPA: | |||||
case MENU_SPEAK_IPA: | |||||
t_phonetic->SetDefaultStyle(style_phonetic_large); | |||||
translate_text = 3; | |||||
break; | |||||
case T_PROCESS: | |||||
case MENU_SPEAK_TEXT: | |||||
if(prosodycanvas == NULL) | |||||
{ | |||||
myframe->OnProsody(event); | |||||
} | |||||
prosodycanvas->LayoutData(ph_list,n_ph_list); | |||||
option_phoneme_events = 1; | |||||
option_log_frames = 1; | |||||
MakeWave2(ph_list,n_ph_list); | |||||
option_log_frames = 0; | |||||
break; | |||||
} | |||||
if(translate_text) | |||||
{ | |||||
option_phonemes = translate_text; | |||||
option_multibyte = espeakCHARS_AUTO; | option_multibyte = espeakCHARS_AUTO; | ||||
SpeakNextClause(NULL,NULL,2); // stop speaking file | SpeakNextClause(NULL,NULL,2); // stop speaking file | ||||
if(clause_count++ > 0) | if(clause_count++ > 0) | ||||
strcat(phon_out," ||"); | strcat(phon_out," ||"); | ||||
strcat(phon_out,translator->phon_out); | strcat(phon_out,translator->phon_out); | ||||
t_phonetic->SetValue(wxString(translator->phon_out,wxConvLocal)); | t_phonetic->SetValue(wxString(translator->phon_out,wxConvUTF8)); | ||||
if((n_ph_list + n_phoneme_list) >= N_PH_LIST) | if((n_ph_list + n_phoneme_list) >= N_PH_LIST) | ||||
{ | { | ||||
fclose(f_trans); | fclose(f_trans); | ||||
remove(fname_temp); | remove(fname_temp); | ||||
} | } | ||||
t_phonetic->AppendText(wxString(phon_out,wxConvLocal)); | t_phonetic->AppendText(wxString(phon_out,wxConvUTF8)); | ||||
break; | |||||
case T_PROCESS: | |||||
case MENU_SPEAK_TEXT: | |||||
if(prosodycanvas == NULL) | |||||
{ | |||||
myframe->OnProsody(event); | |||||
} | |||||
prosodycanvas->LayoutData(ph_list,n_ph_list); | |||||
option_phoneme_events = 1; | |||||
option_log_frames = 1; | |||||
MakeWave2(ph_list,n_ph_list); | |||||
option_log_frames = 0; | |||||
break; | |||||
} | } | ||||
} // end of TranslDlg::OnCommand | } // end of TranslDlg::OnCommand |