Browse Source

[1.31.19}

Fix: Events callback, fix word length information for words with multibyte characters.
Fix: Re-translating a word in a different language after the first langauge has started speaking individual letters, gave silence.
Announce punctuation.  If character name is not defined, use English.
Announce punctuation.  Fix pitch of the voice which announces punctuation characters.
[[Phonemes]] text input.  Allow the language-switch phoneme eg. [[_^_EN hEloU _^_FR]] in the input.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@152 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 17 years ago
parent
commit
417395b033

+ 18
- 18
dictsource/dict_phonemes View File

Dictionary de_dict Dictionary de_dict


3 @ @- a A A: aI aU 3 @ @- a A A: aI aU
E E2 E: e: EI I i2 i:
O o: OY U u: W y y:
Y:
E E2 E: e: EI I i2 I:
i: O o: OY U u: W y
y: Y:


* : ; b C C2 d D * : ; b C C2 d D
dZ f g h j k l m dZ f g h j k l m


Dictionary es_dict Dictionary es_dict


@- a aI aU e E eI eU
i o O oI u
a aI aU e E eI eU i
o O oI u


* ** : b B d D f * ** : b B d D f
g j J J^ k l m n g j J J^ k l m n
W~ y Y W~ y Y


* : ; b c d dZ f * : ; b c d dZ f
g h j k l L m n
N n2 n^ p p2 r R s
S t t2 tS v w z Z
z2 z3
g h j k l m n N
n2 n^ p p2 r R s S
t t2 tS v w z Z z2
z3




Dictionary hi_dict Dictionary hi_dict
g h j k l l^ m n g h j k l l^ m n
N n^ p Q r R r- s N n^ p Q r R r- s
S s# s; t T tS ts v S s# s; t T tS ts v
w x z Z
w w2 x z Z




Dictionary ro_dict Dictionary ro_dict
i i. i[ iou N- o o- ou i i. i[ iou N- o o- ou
u uai y u uai y


(u) : f h j k kh l
m n N p ph r s s.
S; t th ts ts. ts. tS; tS;
tsh v w x z z.
: f j k kh l m n
N p ph r R s s. S;
t th ts ts. ts. tS; tS; tsh
v w x z z.




Dictionary jbo_dict Dictionary jbo_dict


a e i o u a e i o u


* b B c d dZ f g
h j J k l m n N
n^ p q s S S; t tS
w x z
* : b B c d dZ f
g h j J k l m n
N n^ p q s S S; t
tS v w x z

+ 67
- 10
dictsource/en_list View File

_#9 tab _#9 tab
_#32 speIs _#32 speIs


_  hA@dspeIs // U+00A0 no-break-space
_! Ekskl@m'eIS@n _! Ekskl@m'eIS@n
_" kwoUts _" kwoUts
_# haS _# haS
?5 _% pVRs'Ent ?5 _% pVRs'Ent
_& amp@sand _& amp@sand
_' praIm _' praIm
_( ElbrakIt
_) A@brakIt
_( lEftbrakIt
_) raItbrakIt
_* ast@rIsk _* ast@rIsk
_+ plVs _+ plVs
_, k0m@ _, k0m@
_> A@aNg@L _> A@aNg@L
_? kwEstS@n _? kwEstS@n
_@ at|saIn _@ at|saIn
_[ Elskwe@
_[ lEftskwe@
_\ bakstroUk _\ bakstroUk
_] A@skwe@
_] raItskwe@
_^ s3:kVmfl,Eks _^ s3:kVmfl,Eks
?5 _^ sIRkVmfl,Eks ?5 _^ sIRkVmfl,Eks
__ 'Vnd3sk,o@ __ 'Vnd3sk,o@
_` bakpraIm _` bakpraIm
_{ ElbreIs
_{ lEftbreIs
_| vi:b'A@ _| vi:b'A@
_} A@breIs
_} raItbreIs
_~ tIld@ _~ tIld@

_¡ I2nv3:tI2dEkskl@m'eIS@n
_¦ broUk@nb'A@
_¨ daIa2r'i:sI2s
_ª fEmI2nI2n'O@dI2n@L
_« lEft'ang@LkwoUts
_­ makr0n
_² su:p@skrIptt'u:
_³ su:p@skrIptT'ri:
_´ a2kju:taksEnt
_· mId@Ld0t
_¸ sEd'Il@
_¹ su:p@skrIptw'0n
_º maskjUlI2n'O@dI2n@L
_» raIt'ang@LkwoUts
_¿ I2nv3:tI2dkw'EstS@n

_‐ haIf@n
_‑ haIf@n
_‒ daS
_– daS
_— EmdaS
_― h0rIz,0nt@Lb'A@
_‖ d,Vb@Lb'A@
_‘ lEftkwoUt
_’ raItkwoUt
_‚ loUkwoUt
_‛ lEftkwoUt
_“ lEftkwoUts
_” raItkwoUts
_„ loUkwoUts
_‟ lEftkwoUts
_† dag3
_‡ dVb@Ldag3
_• bUlI2t
_‣ bUlI2t
_․ d0t
_‥ tu:d0ts
_… I2lIpsI2s
_‰ p3:m'i:l
_′ praIm
_″ dVb@LpraIm
_‴ trIp@LpraIm
_‼ Ekskla2m'eIS@nz
_₠ jU@roU

¢ sEnts
£ paUnd £ paUnd
¥ jEn ¥ jEn
₨ ru:pi:
₩ w0n
§ sEkS@n § sEkS@n
_¶ par@graf // in en_rules
¶ par@graf // in en_rules
¤ kVr@nsI2saIn ¤ kVr@nsI2saIn
© k0pI2raIt © k0pI2raIt
® rEdZIst3d
° dI2gri:z ° dI2gri:z
− maIn@s − maIn@s
± plVs@maIn@s ± plVs@maIn@s
€ jU@roUz € jU@roUz
♯ SA@p ♯ SA@p
♭ flat ♭ flat
¬ n0t_|saIn
ə SwA: ə SwA:
æ eI'i:
ɛ oUp@n'i:
ɔ oUp@n'oU
ð ED
ʃ ES
ʒ EZ


// numeric // numeric


leapt lEpt leapt lEpt
lego lEgoU lego lEgoU
leisure l'EZ3 leisure l'EZ3
lemme lElI // let me
lemonade $3 lemonade $3
leo li:oU leo li:oU
leopard lEp@d leopard lEp@d
and %and $pause $only and %and $pause $only
as ,az $pause $only as ,az $pause $only
(as is) ,az,Iz $pause (as is) ,az,Iz $pause
(as it is) azIt'Iz_
(as it is) ,azIt,Iz $u+
because bIk'Vz $pause because bIk'Vz $pause
once $pause once $pause
or %O@ $pause $only or %O@ $pause $only






// ?6 'one' = [wVn], 'of' = [Vv]
?6 noone noUwVn ?6 noone noUwVn
?6 anyone EnIwVn ?6 anyone EnIwVn
?6 everyone EvrIwVn ?6 everyone EvrIwVn

+ 3
- 3
dictsource/en_rules View File

μ m'ju:_ μ m'ju:_
ν n'ju:_ ν n'ju:_
ξ ks'aI_ ξ ks'aI_
ο oUm'aIkr0n_
ο 'oUmIkr0n_


.group 0xcf // Greek letters .group 0xcf // Greek letters


ψ ps'aI_ ψ ps'aI_
ω 'oUmIg@_ ω 'oUmIg@_
ώ 'oUmIg@_ ώ 'oUmIg@_
ό oUm'aIkr0n_
ό 'oUmIkr0n_




// default group for "non of the above" // default group for "non of the above"
ž Z ž Z
þ T þ T
ð D ð D
ñ n^




\\ bakstroUk \\ bakstroUk
%%) % (_ _:: %%) % (_ _::


// extra symbols (mostly in en_list) // extra symbols (mostly in en_list)
¶ par@graf
¶¶ par@grafs ¶¶ par@grafs

+ 0
- 1
dictsource/eo_list View File

// This file is UTF-8 encoded // This file is UTF-8 encoded



// Numbers // Numbers
_0 nul _0 nul
_1 'unu _1 'unu

+ 15
- 15
dictsource/es_list View File

_: d,Osp'untOs _: d,Osp'untOs
_! TE*R'aRaDmi**aTj'On _! TE*R'aRaDmi**aTj'On
_? TE*R'aRintE*R,oQaTj'On _? TE*R'aRintE*R,oQaTj'On
_¡ aB@-*'iRaDmi**aTj'On
_¿ aB@-*'iRintE*R,oQaTj'On
_¡ aB**'iRaDmi**aTj'On
_¿ aB**'iRintE*R,oQaTj'On
_= iQw'al _= iQw'al
_< men'ORke _< men'ORke
_> maJ^'ORke _> maJ^'ORke
_' apOst@-*'ofo
_' apOst**'ofo
_" kom'iJ^as _" kom'iJ^as
_+ s'iQnOdesum'aR _+ s'iQnOdesum'aR
_$ dolar _$ dolar
_# almoaD'iJ^a _# almoaD'iJ^a
_* aste*'isko _* aste*'isko
_- gJ^On _- gJ^On
__ suB@-*aJ^'aDo
__ suB**aJ^'aDo
_/ ba*Ra _/ ba*Ra
_\ b'a*RaimbERt'iDa _\ b'a*RaimbERt'iDa
_` aT'EntOg@-*'aBe
_( ,aB@-*epa**'Entesis
_` aT'EntOg**'aBe
_( ,aB**epa**'Entesis
_) Tj,E*Rapa**'Entesis _) Tj,E*Rapa**'Entesis
_[ ,aB@-*ekORtS'ete
_[ ,aB**ekORtS'ete
_] Tj,E*RakORtS'ete _] Tj,E*RakORtS'ete
_{ ,aB@-*eJ^'aBe
_{ ,aB**eJ^'aBe
_} Tj,E*RaJ^'aBe _} Tj,E*RaJ^'aBe
_« kom'iJ^as||iTkJ^'ERDas _« kom'iJ^as||iTkJ^'ERDas
_» kom'iJ^as||dE**'EtSas _» kom'iJ^as||dE**'EtSas
@ a*R'oBa @ a*R'oBa
/ ba*Ra / ba*Ra
© kopi*R'aIt © kopi*R'aIt
£ liB@-*as
£ liB**as
¶ p'a*Rafo ¶ p'a*Rafo
§ sEkTj'On § sEkTj'On


_0 Te*o _0 Te*o
_1 'uno _1 'uno
_2 d'Os _2 d'Os
_3 t@-*'es
_4 kw'at@-*o
_3 t**'es
_4 kw'at**o
_5 T'inko _5 T'inko
_6 s'eIs _6 s'eIs
_7 sj'ete _7 sj'ete
_1X dj'ET _1X dj'ET
_11 'OnTe _11 'OnTe
_12 d'oTe _12 d'oTe
_13 t@-*'eTe
_13 t**'eTe
_14 kat'ORTe _14 kat'ORTe
_15 k'inTe _15 k'inTe
_20 v'eInte _20 v'eInte
_2X v'eInt _2X v'eInt
_3X t@-*'eInta
_3X t**'eInta
_4X kwa*'Enta _4X kwa*'Enta
_5X Tinkw'Enta _5X Tinkw'Enta
_6X sEs'Enta _6X sEs'Enta
o o $atend o o $atend
v uve v uve
x Ekis x Ekis
_y ,ig@-*'iEQa
y ,ig@-*'iEQa $atend
_y ,ig**'iEQa
y ,ig**'iEQa $atend
ch tSe ch tSe
ll Ejje ll Ejje
á 'a||aTEntw'aDa á 'a||aTEntw'aDa

+ 6
- 2
dictsource/es_rules View File

// ?2 Latin America // ?2 Latin America


.L01 j w l r d g n m .L01 j w l r d g n m
.L02 b d g n m // change [s] to [z] before these


.group a .group a
_) a (_ a _) a (_ a
_) d (_ de _) d (_ de
d D d D
_) d d _) d d
l) d d
m) d d m) d d
n) d d n) d d


r R r R
_) r R _) r R
A) r (A ** A) r (A **
C) r (A @-*
C) r (A **
rr *R rr *R




_) s (_ Ese _) s (_ Ese
s s s s
&) s (_S1 s &) s (_S1 s
s (L02 z
s (gY s




.group t .group t




.group y .group y
_) y (_ ,ig@-*'iEQa
_) y (_ ,ig**'iEQa
y i y i
_) y J _) y J
_m) y J _m) y J

+ 24
- 10
dictsource/fr_list View File



//_cap k,ap@-t@L //_cap k,ap@-t@L
_?A lEt@ _?A lEt@
_?? sE~b'OL
_?? sE~b'Oll
_#9 tabylasjO~ _#9 tabylasjO~
_#32 Espas _#32 Espas




// articles // articles
le $u $nounf le $u $nounf
le $u $verb $verbextend
la $u $nounf la $u $nounf
la $u $verb $verbextend
les lez2 $u $nounf les lez2 $u $nounf
?2 les lez2 $u $nounf
les lez2 $u $verb $verbextend
un $u $nounf un $u $nounf
une $u $nounf une $u $nounf




ce $u $nounf ce $u $nounf
cette $u $nounf cette $u $nounf
ces sEz2 $u $nounf
ces sez2 $u $nounf
ceci $verbf
cela $verbf
(celle ci) sEl||si $verbf
(celle là) sEl||la $verbf
(ceux ci) sY||si $verbf
(ceux là) sY||la $verbf
(celles ci) sEl||si $verbf
(celles là) sEl||la $verbf


// possessives // possessives
ma $u+ $nounf ma $u+ $nounf
ses sez2 $u+ $nounf ses sez2 $u+ $nounf
notre $u+ $nounf notre $u+ $nounf
votre $u+ $nounf votre $u+ $nounf
leur $u+
leur $u+ $nounf
leur $u+ $verb $verbextend
(la leur) la||l@r $u+ $verbf
(le leur) l@||l@r $u+ $verbf
nos $u+ $nounf nos $u+ $nounf
vos $u+ $nounf vos $u+ $nounf
leurs $u+
leurs $u+ $nounf
leurs $u+ $verb $verbextend
(les leur) le||l@r $u+ $verbf
(les leurs) le||l@r $u+ $verbf


// prepositions // prepositions
de $u $nounf de $u $nounf
du $u+ $nounf du $u+ $nounf
des dez2 $u $nounf des dez2 $u $nounf
?2 des dez2 $u+ $nounf




à $u à $u
sans $u sans $u
sous $u sous $u
entre $u $brk entre $u $brk
contre $u $brk
contre $u


durant $brk durant $brk


dessus d@sy dessus d@sy
dessous d@su dessous d@su
divers divErz2 divers divErz2
parent paR'A~
parent p'art2 $verb
hareng _!arA~
pastis pastis pastis pastis
poing pwE~ poing pwE~
ressent r@s'A~t2 ressent r@s'A~t2
vénus venys vénus venys




gens ZA~
mens mA~z2 mens mA~z2
sens sA~s sens sA~s
sens sA~z2 $verb sens sA~z2 $verb








+ 49
- 21
dictsource/fr_rules View File



// 2006-11-18 Gilles Casse <[email protected]> // 2006-11-18 Gilles Casse <[email protected]>
// //
// Updated: 2008-02-24 Michel Such <[email protected]>
// Updated: 2008-02-26 Michel Such <[email protected]>
// //
// * The rules are based on Cicero TTS. // * The rules are based on Cicero TTS.
// Y // Y
_noeu) d (_ // noeud _noeu) d (_ // noeud
r) d (_ // lourd placard r) d (_ // lourd placard
d d // don bled d d // don bled
_expé) dien (t_ djA~ // expédient
V_expé) dien (t_ di // expédient
_ingré) dien (t_ djA~ // ingrédient
dien (t_ di // étudient (verbe)


// group d: English section // group d: English section
day (_ _^_en day (_ _^_en
C) en (d_ A~ // comprend dépend C) en (d_ A~ // comprend dépend
od) en (dr E~ // rhododendron od) en (dr E~ // rhododendron
C) en (ds_ A~ C) en (ds_ A~
cipi) en (C A~ // récipient
qu) en (d_ A~ qu) en (d_ A~
qu) en (ds_ A~ qu) en (ds_ A~


_C) en (t_ A~ // cent vent lent dent _C) en (t_ A~ // cent vent lent dent
cc) en (t_ A~ // accent cc) en (t_ A~ // accent
Asc) en (t_ A~ // luminescent Asc) en (t_ A~ // luminescent
dol) en (t_ A~ // dolent
_dol) en (t_ A~ // dolent
ol) en (t_ A~ // somnolent, violent
Vol) en (t_ // somnolent, violent
imCoC) en (t_ A~ // impotent imCoC) en (t_ A~ // impotent
inCoC) en (t_ A~ // innocent, indolent inCoC) en (t_ A~ // innocent, indolent


oémin) en (t_ A~ // proéminent oémin) en (t_ A~ // proéminent
jac) en (t_ A~ // sous-jacent, adjacent jac) en (t_ A~ // sous-jacent, adjacent
_lat) en (t_ A~ // latent _lat) en (t_ A~ // latent
lig) en (t_ A~ // intelligent

@@Cig) en (t_ A~ // intransigent, intelligent
_dilig) en (t_ A~ // diligent
XACig) en (t_ A~ // dirigent, exigent
VXACig) en (t_ // dirigent, exigent (verbe)
flig) en (t_ A~ // affligent
Vflig) en (t_ // infligent (verbe)
Xig) en (t_ // figent, pigent
oblig) en (t_ A~ // obligent, d‚sobligent
Voblig) en (t_ // obligent (verbe)

man) en (t_ A~ // permanent man) en (t_ A~ // permanent
ndig) en (t_ A~ // indigent
@@ing) en (t_ A~ // astreingent, contingentindigent
_pat) en (t_ A~ // patent _pat) en (t_ A~ // patent
rmam) en (t_ A~ // firmament rmam) en (t_ A~ // firmament
xig) en (t_ A~ // exigent
Vxig) en (t_ // exigent
éCerg) en (t_ A~ // détergent éCerg) en (t_ A~ // détergent
V_éCerg) en (t_ // émergent V_éCerg) en (t_ // émergent
verg) en (t_ A~ // convergent, divergent verg) en (t_ A~ // convergent, divergent
Atim) en (t_ A~ // bâtiment Atim) en (t_ A~ // bâtiment
_cim) en (t_ A~ // ciment _cim) en (t_ A~ // ciment
_pim) en (t_ A~ // piment _pim) en (t_ A~ // piment

ertin) en (t_ A~ // pertinent, impertinent
ontin) en (t_ A~ // continent, incontinent
erm) en (t_ A~ // ferment, serment erm) en (t_ A~ // ferment, serment
Vferm) en (t_ // ferment, referment (verbe) Vferm) en (t_ // ferment, referment (verbe)
Arp) en (t_ A~ // arpent, serpent Arp) en (t_ A~ // arpent, serpent
CArr) en (t_ A~ // conncurrent, torrent CArr) en (t_ A~ // conncurrent, torrent
_appar) en (t_ A~ // apparent
spar) en (t_ A~ // transparent
_par) en (t_ A~ // parent
V_par) en (t_ // parent (verbe)
_var) en (t_ A~ // varent
mitt) en (t_ A~ // intermittent mitt) en (t_ A~ // intermittent
énit) en (t_ A~ // pénitent énit) en (t_ A~ // pénitent
tourm) en (t_ A~ // tourment tourm) en (t_ A~ // tourment

ti) en (t_ E~ // retient
ati) en (t_ A~ // patient
oti) en (t_ A~ // quotient

vi) en (t_ E~
Cflu) en (t_ A~ // affluent, confluent
VCflu) en (t_ // refluent, influent (verbe)


al) en (t_ A~ // talent équivalent al) en (t_ A~ // talent équivalent
Vival) en (t_ // équivalent (verbe)
xcell) en (t_ A~ // excellent xcell) en (t_ A~ // excellent
nn) en (t_ t2 // prennent, viennent, sonnent nn) en (t_ t2 // prennent, viennent, sonnent


en (t_ // étaient mangent en (t_ // étaient mangent


Ci) en (_ E~ // viendra Ci) en (_ E~ // viendra
Ci) en (C E~ // tien
Ci) en (C E~ // viendra
Ci) en (c A~ // science Ci) en (c A~ // science




ed (_ _^_en ed (_ _^_en
_) edit _^_en _) edit _^_en
ee _^_en // meeting ee _^_en // meeting
eing _^_en // being, goeing
eing (_ _^_en // being, boeing
eive _^_en // receive eive _^_en // receive
ej _^_en ej _^_en
eld (_ _^_en // field eld (_ _^_en // field
enter (_ _^_en // enter, center
_) enter (_ _^_en // enter
_) enhan _^_en _) enhan _^_en
ack) et (_ _^_en // racket, packet ack) et (_ _^_en // racket, packet
ock) et (_ _^_en // rocket, pocket ock) et (_ _^_en // rocket, pocket
i i // cri i i // cri


ie (ment i // remerciement balbutiement ie (ment i // remerciement balbutiement
C) ien (t_ i
dév) ien (t_ i
t) ien (t_ jE~ // vient
v) ien (t_ jE~ // tient
at) ien (t_ jA~ // patient
cip) ien (C jA~ // récipient
vén) ien (C jA~ // inconvénient
ot) ien (t_ jA~ // quotient

i (es_ i // parties i (es_ i // parties
i (e_ i i (e_ i
i (A j // fermier portier patio renier i (A j // fermier portier patio renier
mm m // pomme mm m // pomme


// group m: English section // group m: English section
mail (A _^_en // mailer
_) mail (_ _^_en // mailer
mov (A _^_en // move, movy mov (A _^_en // move, movy






a) t (ia s // spatial a) t (ia s // spatial
en) t (ia s // confidentialit� en) t (ia s // confidentialit�
u) t (ia s // balbutiait
bu) t (iA s // balbutiait
r) t (ia s // impartial r) t (ia s // impartial
i) t (ia s // initia
ini) t (i s // initier
p) t (ia s // nuptial p) t (ia s // nuptial
an) t (iat s // transsubstantiation an) t (iat s // transsubstantiation


pa) t (ien s pa) t (ien s
o) t (ien s o) t (ien s


Cu) t (ie_ s // minutie
Cu) t (ies_ s
Cu) t (ieX s // minutie
ni) tien (t_ si
bu) tien (t_ si


cra) t (ie_ s // démocratie cra) t (ie_ s // démocratie
cra) t (ies_ s cra) t (ies_ s

+ 121
- 103
dictsource/grc_rules View File

// Replace Latin characters by same-shape Greek characters // Replace Latin characters by same-shape Greek characters


.replace .replace
′ '
a α // Latin->Greek a α // Latin->Greek
o ο o ο
v ν v ν
Y Υ Y Υ
X Χ X Χ


// replace Latin characters by Greek equivalents
th θ
ph φ
kh χ
ps ψ
b β
g γ
d δ
e ε
z ζ
q η // (long e; not standard transliteration but may be easier to type than η)
i ι
k κ
l λ
m μ
n ν
x ξ
p π
r ρ
s σ
t τ
u υ
y υ
w ω // (long o; not standard transliteration but may be easier to type


// alpha // alpha
ά ὰ // tonos ά ὰ // tonos
ά ὰ // oxia ά ὰ // oxia




.group α .group α
α a
αι aI
αὶ 'aI
αυ aU
αὺ 'aU
αhι haI
αhὶ 'haI
αhυ haU
αhὺ 'haU
α a
αι aI
αὶ 'aI
αυ aU
αὺ 'aU
αhι haI
αhὶ 'haI
αhυ haU
αhὺ 'haU


.group β .group β
β b
β b




.group γ .group γ
γ g
γγ Ng
γ g
γγ Ng


.group δ .group δ
δ d
δ d




.group ε .group ε
ε e
ει e:
εὶ 'e:
ευ eU
εὺ 'eU
εhι he:
εhὶ 'he:
εhυ heU
εhὺ 'heU
ε e
ει e:
εὶ 'e:
ευ eU
εὺ 'eU
εhι he:
εhὶ 'he:
εhυ heU
εhὺ 'heU


.group ζ .group ζ
ζ z
ζ z




.group η .group η
η E:
ηι EI:
ηὶ 'EI:
ηυ EU:
ηὺ 'EU:
ηhι hEI:
ηhὶ 'hEI:
ηhυ hEU:
ηhὺ 'hEU:
η E:
ηι EI:
ηὶ 'EI:
ηυ EU:
ηὺ 'EU:
ηhι hEI:
ηhὶ 'hEI:
ηhυ hEU:
ηhὺ 'hEU:


.group θ .group θ
θ T
θ T




.group ι .group ι
ι i
ι i




.group ϊ .group ϊ
ϊ i
ϊ i




.group κ .group κ
κ k
κ k




.group λ .group λ
λ l
λ l




.group μ .group μ
μ m
μ m




.group ν .group ν
ν n
ν n




.group ξ .group ξ
ξ ks
ξ ks




.group ο .group ο
ο o
οι oI
οὶ 'oI
ου u:
οὺ 'u:
οhι hoI
οhὶ 'hoI
οhυ hu:
οhὺ 'hu:
ο o
οι oI
οὶ 'oI
ου u:
οὺ 'u:
οhι hoI
οhὶ 'hoI
οhυ hu:
οhὺ 'hu:


.group π .group π
π p
π p




.group ρ .group ρ
ρ R
ρ R




.group ς .group ς
ς s
ς s




.group σ .group σ
σ s
σ s




.group τ .group τ
τ t
τ t




.group υ .group υ
υ y
υι yI
υὶ 'yI
υhι hyI
υhὶ 'hyI
υ y
υι yI
υὶ 'yI
υhι hyI
υhὶ 'hyI


.group ϋ .group ϋ
ϋ y
ϋι yI
ϋὶ 'yI
ϋhι hyI
ϋhὶ 'hyI
ϋ y
ϋι yI
ϋὶ 'yI
ϋhι hyI
ϋhὶ 'hyI


.group φ .group φ
φ f
φ f




.group χ .group χ
χ x
χ x




.group ψ .group ψ
ψ ps
ψ ps




.group ω .group ω
ω O:
ωι OI:
ωὶ 'OI:
ωυ OU:
ωὺ 'OU:
ωhι hOI:
ωhὶ 'hOI:
ωhυ hOU:
ωhὺ 'hOU:
ω O:
ωι OI:
ωὶ 'OI:
ωυ OU:
ωὺ 'OU:
ωhι hOI:
ωhὶ 'hOI:
ωhυ hOU:
ωhὺ 'hOU:






.group h // dasia (rough breathing) .group h // dasia (rough breathing)
h h
h h




.group .group
ὰ 'a
ᾳ aI:
ᾲ 'aI:
ὲ 'e
ὴ 'E:
ῃ EI:
ῂ 'EI:
ὶ 'i
ῒ 'i
ὸ 'o
ὺ 'y
ῢ 'y
ὼ 'O:
ῳ OI:
ῲ 'OI:











ὰ 'a
ᾳ aI:
ᾲ 'aI:
ὲ 'e
ὴ 'E:
ῃ EI:
ῂ 'EI:
ὶ 'i
ῒ 'i
ὸ 'o
ὺ 'y
ῢ 'y
ὼ 'O:
ῳ OI:
ῲ 'OI:

' = // apostrophe used as tonos, stress on previous syllable

+ 2
- 2
dictsource/pt_list View File





_cap maI'uskulU _cap maI'uskulU
_?A l'etR&
_?? s'imbolU
_?A l'etR&_
_?? s'imbolU_


_. p'oNtU _. p'oNtU
_! ,eskl&mas'&U~ _! ,eskl&mas'&U~

+ 4
- 4
dictsource/ta_rules View File

க (் g க (் g
்) க ga ்) க ga
்) க (B g ்) க (B g
_) க kV
_) க ka
_) க (B k _) க (B k
க்க k:a க்க k:a
க்க (B k: க்க (B k:


ட d.a ட d.a
ட (B d. ட (B d.
_) ட t.V
_) ட t.a
_) ட (B t. _) ட (B t.
ட்ட t.a ட்ட t.a
ட்ட (B t. ட்ட (B t.


த da த da
த (B d த (B d
_) த tV
_) த ta
_) த (B t _) த (B t
த்த t:a த்த t:a
த்த (B t: த்த (B t:


ப ba ப ba
ப (B b ப (B b
_) ப pV
_) ப pa
_) ப (B p _) ப (B p
ப்ப p:a ப்ப p:a
ப்ப (B p: ப்ப (B p:

+ 5
- 4
dictsource/zh_rules View File



.group c .group c
c tsh c tsh
ch ts.h
ch (+ ts.h
@) c (K _^_EN @) c (K _^_EN


.group d .group d
.group l .group l
l l l l
@) l (K _^_EN @) l (K _^_EN
@) l (v l


.group m .group m
m m m m


.group s .group s
s s s s
sh s.
sh (+ s.
@) s (K _^_EN @) s (K _^_EN


.group t .group t
n) ve yE //üe n) ve yE //üe


.group w .group w
// @) w (K _^_EN
@) w (K _^_EN
wa wA //wa wan wang wa wA //wa wan wang
wai wai wai wai
wa1i wai55 wa1i wai55


.group z .group z
z ts z ts
zh ts.
zh (+ ts.
@) z (K _^_EN @) z (K _^_EN


//tone number //tone number

+ 54
- 55
phsource/compile_report View File

50 phoneme tables 50 phoneme tables
new total new total
base 99 99
base2 24 118
en 53 147
en_n 30 147
en_us 34 147
en_sc 39 149
en_rp 34 147
en_wm 30 147
en_wi 30 147
af 38 131
cy 29 125
de 33 126
eo 13 111
jbo 4 112
fi 40 130
fr 44 125
fr_ca 11 125
hi 51 136
ta 16 139
hu 23 115
nl 28 122
pl 15 110
sk 29 128
cs 6 128
hr 20 133
mk 3 134
sr 14 133
ru 38 129
it 17 121
la 21 117
es 9 119
es_la 1 119
pt 27 134
pt_pt 20 134
ro 36 142
el 8 118
grc 12 123
sv 25 121
no 28 125
is 32 124
vi 42 137
zhy 40 132
zh 65 149
sw 14 108
th 50 142
id 14 120
tr 18 123
ku 13 120
ja 7 104
rw 12 123
base 98 98
base2 24 117
en 51 144
en_n 30 144
en_us 34 144
en_sc 39 146
en_rp 34 144
en_wm 30 144
en_wi 30 144
af 38 130
cy 29 124
de 33 125
eo 13 110
jbo 4 111
fi 40 129
fr 44 124
fr_ca 11 124
hi 51 135
ta 16 138
hu 23 114
nl 28 121
pl 15 109
sk 29 127
cs 6 127
hr 20 132
mk 3 133
sr 14 132
ru 38 128
it 17 120
la 21 116
es 9 118
es_la 1 118
pt 27 133
pt_pt 20 133
ro 36 141
el 8 117
grc 12 122
sv 25 120
no 28 124
is 32 123
vi 42 136
zhy 40 131
zh 65 148
sw 14 107
th 50 141
id 14 119
tr 18 122
ku 13 119
ja 7 103
rw 12 122


Data file Used by Data file Used by
b/b [b] base b/b [b] base
r3/rz_cs [R^] sk r3/rz_cs [R^] sk
[R^/] sk [R^/] sk
r3/@tap [**] base r3/@tap [**] base
r3/@tap2 [**] base
r/r [r] base r/r [r] base
[r-] base [r-] base
[r] en_sc [r] en_sc
vdiph/@u_en [oU] en vdiph/@u_en [oU] en
[@U] id [@U] id
vdiph/ui [uI] base2 vdiph/ui [uI] base2
[uI] en
[uI] eo [uI] eo
[ui] fi [ui] fi
[uI] vi [uI] vi
vnasal/u_n [u~] hi vnasal/u_n [u~] hi
[u~] pt [u~] pt
[u] zh [u] zh
vnasal/W_n [W~] en
[E~] fr
vnasal/W_n [E~] fr
[W~] fr [W~] fr
voc/bh [B] base voc/bh [B] base
voc/dh [D] base voc/dh [D] base
vowel/i#_5 [y] pt_pt vowel/i#_5 [y] pt_pt
[i/] pt_pt [i/] pt_pt
[y] ro [y] ro
vowel/i_6 [i:] en_us
[i] ta
vowel/i_6 [i] ta
[i] hr [i] hr
[i] id [i] id
[i] tr [i] tr
vowel/i#_6 [i.] zh vowel/i#_6 [i.] zh
vowel/i#_7 [i[] zh vowel/i#_7 [i[] zh
vowel/i_en [i:] en vowel/i_en [i:] en
[i:] en_us
[i:] fr [i:] fr
[i] vi [i] vi
vowel/i_fnt [i:] en_wi vowel/i_fnt [i:] en_wi

BIN
phsource/n^/n^@ View File


BIN
phsource/n^/n^a View File


BIN
phsource/n^/n^e View File


BIN
phsource/n^/n^o View File


BIN
phsource/n^/n^u View File


+ 1
- 15
phsource/ph_english View File



phoneme e@ phoneme e@
vowel starttype (e) endtype (@) vowel starttype (e) endtype (@)
length 220
length 230
formants vowel/ee_1 formants vowel/ee_1
linkout r- linkout r-
endphoneme endphoneme
endphoneme endphoneme




phoneme uI
vowel starttype (u) endtype (i)
length 240
formants vdiph/ui
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
endphoneme endphoneme




phoneme W~
vowel starttype (@) endtype (@)
length 260
formants vnasal/W_n
endphoneme


phoneme y: phoneme y:
vowel starttype (u) endtype (u) vowel starttype (u) endtype (u)
length 220 length 220

+ 1
- 1
phsource/ph_english_us View File

phoneme i: phoneme i:
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 170 length 170
formants vowel/i_6
formants vowel/i_en
linkout ; linkout ;
endphoneme endphoneme



+ 1
- 11
phsource/phonemes View File

phonemenumber 25 t# // reduced version of [t] phonemenumber 25 t# // reduced version of [t]
phonemenumber 26 '! // stress - emphasized phonemenumber 26 '! // stress - emphasized
phonemenumber 27 _;_ // clause pause phonemenumber 27 _;_ // clause pause
phonemenumber 28 _^^ // Change language + phoneme table number


// The base phoneme table contains the utility phonemes, the consonants, // The base phoneme table contains the utility phonemes, the consonants,
// and a schwa. The vowels are defined in the language specific phoneme // and a schwa. The vowels are defined in the language specific phoneme
lengthmod 1 lengthmod 1
endphoneme endphoneme


phoneme _^^ // Change phoneme table (followed by phoneme table number)
pause
starttype _ endtype _
length 1
lengthmod 1
endphoneme

phoneme _X1 // a language specific action phoneme _X1 // a language specific action
pause pause
starttype _ endtype _ starttype _ endtype _
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
formants r3/@tap formants r3/@tap
// vowelin f1=3 f2=1600 -300 300 f3=-300 80
// before (i) r3/@tap_i+r3/rx
// before (e) r3/@tap_i+r3/rx
after (e) r3/@tap2
endphoneme endphoneme





BIN
phsource/r3/@tap_i → phsource/r3/@tap2 View File


BIN
phsource/ustop/q.wav View File


BIN
phsource/vdiph/8u View File


BIN
phsource/vwl_en_us/a View File


BIN
phsource/vwl_en_us/er View File


BIN
phsource/vwl_en_us/ii View File


+ 28
- 9
src/dictionary.cpp View File

while(!isspace(c = *p++) && (c != 0)) while(!isspace(c = *p++) && (c != 0))
*outptr++ = tolower(c); *outptr++ = tolower(c);
*outptr = 0; *outptr = 0;
if(strcmp(p_lang,"en")==0)
if(c == 0)
{ {
*p_lang = 0; // don't need "en", it's assumed by default
if(strcmp(p_lang,"en")==0)
{
*p_lang = 0; // don't need "en", it's assumed by default
return(p);
}
}
else
{
*outptr++ = '|'; // more phonemes follow, terminate language string with separator
} }
return(p);
} }
break; break;
} }
while(((c = *p) != ' ') && (c != 0)) while(((c = *p) != ' ') && (c != 0))
{ {
if(IsAlpha(wc))
any_alpha++;
wc_prev = wc; wc_prev = wc;
wc_bytes = utf8_in(&wc,p,0); wc_bytes = utf8_in(&wc,p,0);
if(IsAlpha(wc))
any_alpha++;


n = groups2_count[c]; n = groups2_count[c];
if(IsDigit(wc) && ((langopts.tone_numbers == 0) || !any_alpha)) if(IsDigit(wc) && ((langopts.tone_numbers == 0) || !any_alpha))
if(match1.points == 0) if(match1.points == 0)
{ {
static const char str_unknown[4] = {phonCAPITAL,phonCAPITAL,phonCAPITAL,0}; static const char str_unknown[4] = {phonCAPITAL,phonCAPITAL,phonCAPITAL,0};
if(((any_alpha > 0) || (p[wc_bytes-1] > ' ')) && !iswpunct(wc))
if(iswalpha(wc))
{ {
// an unrecognised character in a word, indicate with clicks
match1.phonemes = str_unknown;
match1.points = 1;
if((any_alpha > 1) || (p[wc_bytes-1] > ' '))
{
// an unrecognised character in a word, indicate with clicks
match1.phonemes = str_unknown;
match1.points = 1;
}
}
else
{
LookupLetter(wc, -1, ph_buf);
if(ph_buf[0])
{
match1.phonemes = ph_buf;
match1.points = 1;
}
} }
p += (wc_bytes-1); p += (wc_bytes-1);
} }

+ 37
- 10
src/numbers.cpp View File

char ph_stress[2]; char ph_stress[2];
char ph_buf3[30]; char ph_buf3[30];


ph_buf1[0] = 0;
len = utf8_out(letter,&single_letter[2]);
single_letter[len+2] = ' ';

if(next_byte == -1)
{
// speaking normal text, not individual characters
if(Lookup(&single_letter[2],ph_buf1) != 0)
return;

single_letter[1] = '_';
if(Lookup(&single_letter[1],ph_buf3) != 0)
return; // the character is specified as _* so ignore it when speaking normal text

// check whether this character is specified for English
SetTranslator2("en");
if(translator2->Lookup(&single_letter[2], ph_buf3) != 0)
{
// yes, switch to English and re-translate the word
sprintf(ph_buf1,"%c",phonSWITCH);
}
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
return;
}

if((letter <= 32) || iswspace(letter)) if((letter <= 32) || iswspace(letter))
{ {
// lookup space as _&32 etc. // lookup space as _&32 etc.
return; return;
} }



len = utf8_out(letter,&single_letter[2]);
single_letter[len+2] = ' ';

if(next_byte != ' ') if(next_byte != ' ')
next_byte = RULE_SPELLING; next_byte = RULE_SPELLING;
single_letter[3+len] = next_byte; // follow by space-space if the end of the word, or space-0x31 single_letter[3+len] = next_byte; // follow by space-space if the end of the word, or space-0x31






int Translator::TranslateLetter(char *word, char *phonemes, int control)
{//=====================================================================
int Translator::TranslateLetter(char *word, char *phonemes, int control, int word_length)
{//======================================================================================
// 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 2=say-as glyphs, 3-say-as chars
return(0); return(0);
} }


if(ph_buf[0] == 0)
if((ph_buf[0] == 0) && (word_length == 1) && (translator_name != L('e','n')))
{ {
// ?? speak as English ??
sprintf(phonemes,"%c",phonSWITCH);
return(0);
// speak as English, check whether there is a translation for this character
SetTranslator2("en");
translator2->LookupLetter(letter, word[n_bytes], ph_buf);
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
if(ph_buf[0] != 0)
{
sprintf(phonemes,"%c",phonSWITCH);
return(0);
}
} }


if(ph_buf[0] == 0) if(ph_buf[0] == 0)

+ 111
- 37
src/readclause.cpp View File

static const char *punct_close = ")]}>;'\""; // always pitch fall unless followed by alnum static const char *punct_close = ")]}>;'\""; // always pitch fall unless followed by alnum


// alter tone for announce punctuation or capitals // alter tone for announce punctuation or capitals
static const char *tone_punct_on = "\001+50R\001+10T"; // add reverberation, reduce low frequencies
static const char *tone_punct_off = "\001R\001T";
static const char *tone_punct_on = "\0016T"; // add reverberation, lower pitch
static const char *tone_punct_off = "\001T";


// punctuations symbols that can end a clause // punctuations symbols that can end a clause
static const unsigned short punct_chars[] = {',','.','?','!',':',';',
const unsigned short punct_chars[] = {',','.','?','!',':',';',
0x2013, // en-dash 0x2013, // en-dash
0x2014, // em-dash 0x2014, // em-dash
0x2026, // elipsis 0x2026, // elipsis
} }




const char *WordToString2(unsigned int word)
{//========================================
// Convert a language mnemonic word into a string
int ix;
static char buf[5];
char *p;

p = buf;
for(ix=3; ix>=0; ix--)
{
if((*p = word >> (ix*8)) != 0)
p++;
}
*p = 0;
return(buf);
}


const char *Translator::LookupSpecial(const char *string)
{//======================================================

const char *Translator::LookupSpecial(const char *string, char* text_out)
{//======================================================================
unsigned int flags[2]; unsigned int flags[2];
char phonemes[55]; char phonemes[55];
char phonemes2[55]; char phonemes2[55];
static char buf[60];
char *string1 = (char *)string; char *string1 = (char *)string;


if(LookupDictList(&string1,phonemes,flags,0,NULL)) if(LookupDictList(&string1,phonemes,flags,0,NULL))
{ {
SetWordStress(phonemes,flags[0],-1,0); SetWordStress(phonemes,flags[0],-1,0);
DecodePhonemes(phonemes,phonemes2); DecodePhonemes(phonemes,phonemes2);
sprintf(buf,"[[%s]] ",phonemes2);
sprintf(text_out,"[[%s]]",phonemes2);
option_phoneme_input = 1; option_phoneme_input = 1;
return(buf);
return(text_out);
} }
return(NULL); return(NULL);
} }
// Find the phoneme string (in ascii) to speak the name of character c // Find the phoneme string (in ascii) to speak the name of character c


int ix; int ix;
const char *p;
static char buf[24];
unsigned int flags[2];
char single_letter[24];
char phonemes[60];
char phonemes2[60];
char *lang_name = NULL;
char *string;
static char buf[60];


buf[0] = '_';
ix = utf8_out(c,&buf[1]);
buf[1+ix]=0;
buf[0] = 0;
flags[0] = 0;
flags[1] = 0;
single_letter[0] = 0;
single_letter[1] = '_';
ix = utf8_out(c,&single_letter[2]);
single_letter[2+ix]=0;


if((p = LookupSpecial(buf)) == NULL)
string = &single_letter[1];
if(LookupDictList(&string, phonemes, flags, 0, NULL) == 0)
{ {
p = LookupSpecial(&buf[1]);
// try _* then *
string = &single_letter[2];
if(LookupDictList(&string, phonemes, flags, 0, NULL) == 0)
{
// now try the rules
single_letter[1] = ' ';
TranslateRules(&single_letter[2], phonemes, sizeof(phonemes), NULL,0,0);
}
} }
if(p != NULL)
return(p);


if((p = LookupSpecial("_??")) == NULL)
if((phonemes[0] == 0) && (translator_name != L('e','n')))
{ {
p = "symbol";
// not found, try English
SetTranslator2("en");
string = &single_letter[1];
single_letter[1] = '_';
if(translator2->LookupDictList(&string, phonemes, flags, 0, NULL) == 0)
{
string = &single_letter[2];
translator2->LookupDictList(&string, phonemes, flags, 0, NULL);
}
if(phonemes[0])
{
lang_name = "en";
}
else
{
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
}
} }
strcpy(buf,p);
// sprintf(buf,"%s%d ",p,c);

if(phonemes[0])
{
if(lang_name)
{
translator2->SetWordStress(phonemes,flags[0],-1,0);
DecodePhonemes(phonemes,phonemes2);
sprintf(buf,"[[_^_%s %s _^_%s]]","en",phonemes2,WordToString2(translator_name));
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
}
else
{
SetWordStress(phonemes,flags[0],-1,0);
DecodePhonemes(phonemes,phonemes2);
sprintf(buf,"[[%s]] ",phonemes2);
}
}
else
{
strcpy(buf,"[[(X1)(X1)(X1)]]");
}

option_phoneme_input = 1;
return(buf); return(buf);
} }




p = &buf[bufix]; p = &buf[bufix];
if(punct_count==1) if(punct_count==1)
{
sprintf(p,"%s %s %s",tone_punct_on,punctname,tone_punct_off); sprintf(p,"%s %s %s",tone_punct_on,punctname,tone_punct_off);
}
else else
if(punct_count < 4) if(punct_count < 4)
{ {
const char *p; const char *p;
wchar_t xml_buf[N_XML_BUF+1]; wchar_t xml_buf[N_XML_BUF+1];


#define N_XML_BUF2 12
char buf2[N_XML_BUF2+2];
#define N_XML_BUF2 20
char xml_buf2[N_XML_BUF2+2]; // for &<name> and &<number> sequences
static char ungot_string[N_XML_BUF2+4]; static char ungot_string[N_XML_BUF2+4];
static int ungot_string_ix = -1; static int ungot_string_ix = -1;


c1 = c2; c1 = c2;
while(!Eof() && (iswalnum(c1) || (c1=='#')) && (n_xml_buf < N_XML_BUF2)) while(!Eof() && (iswalnum(c1) || (c1=='#')) && (n_xml_buf < N_XML_BUF2))
{ {
buf2[n_xml_buf++] = c1;
xml_buf2[n_xml_buf++] = c1;
c1 = GetC(); c1 = GetC();
} }
buf2[n_xml_buf] = 0;
xml_buf2[n_xml_buf] = 0;
c2 = GetC(); c2 = GetC();
sprintf(ungot_string,"%s%c%c",&buf2[0],c1,c2);
sprintf(ungot_string,"%s%c%c",&xml_buf2[0],c1,c2);


if(c1 == ';') if(c1 == ';')
{ {
if(buf2[0] == '#')
if(xml_buf2[0] == '#')
{ {
// character code number // character code number
if(buf2[1] == 'x')
found = sscanf(&buf2[2],"%x",(unsigned int *)(&c1));
if(xml_buf2[1] == 'x')
found = sscanf(&xml_buf2[2],"%x",(unsigned int *)(&c1));
else else
found = sscanf(&buf2[1],"%d",&c1);
found = sscanf(&xml_buf2[1],"%d",&c1);
} }
else else
{ {
if((found = LookupMnem(xml_char_mnemonics,buf2)) != -1)
if((found = LookupMnem(xml_char_mnemonics,xml_buf2)) != -1)
{ {
c1 = found; c1 = found;
if(c2 == 0) if(c2 == 0)
clause_upper_count++; clause_upper_count++;
if((option_capitals == 2) && !iswupper(cprev)) if((option_capitals == 2) && !iswupper(cprev))
{ {
p = LookupSpecial("_cap");
if(p != NULL)
char text_buf[40];
char text_buf2[30];
if(LookupSpecial("_cap",text_buf2) != NULL)
{ {
sprintf(buf2,"%s%s%s",tone_punct_on,p,tone_punct_off);
j = strlen(buf2);
sprintf(text_buf,"%s%s%s",tone_punct_on,text_buf2,tone_punct_off);
j = strlen(text_buf);
if((ix + j) < n_buf) if((ix + j) < n_buf)
{ {
strcpy(&buf[ix],buf2);
strcpy(&buf[ix],text_buf);
ix += j; ix += j;
} }
} }
if(speech_parameters[espeakSILENCE]==1) if(speech_parameters[espeakSILENCE]==1)
continue; continue;


j = ix+1;
ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1;
if(!iswspace(c1) && !IsBracket(c1)) if(!iswspace(c1) && !IsBracket(c1))
{ {
charix[ix] = count_characters - clause_start_char; charix[ix] = count_characters - clause_start_char;
while(j < ix)
charix[j++] = 0xffff; // subsequent bytes of a multibyte character
} }
ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1;


if(((ix > (n_buf-20)) && !IsAlpha(c1) && !iswdigit(c1)) || (ix >= (n_buf-2))) if(((ix > (n_buf-20)) && !IsAlpha(c1) && !iswdigit(c1)) || (ix >= (n_buf-2)))
{ {

+ 1
- 1
src/synthdata.cpp View File

#include "translate.h" #include "translate.h"
#include "wave.h" #include "wave.h"


const char *version_string = "1.31.18 25.Feb.08";
const char *version_string = "1.31.19 28.Feb.08";
const int version_phdata = 0x013105; const int version_phdata = 0x013105;


int option_device_number = -1; int option_device_number = -1;

+ 2
- 1
src/synthesize.h View File

#define EMBED_A 3 // amplitude/volume #define EMBED_A 3 // amplitude/volume
#define EMBED_R 4 // pitch range/expression #define EMBED_R 4 // pitch range/expression
#define EMBED_H 5 // echo/reverberation #define EMBED_H 5 // echo/reverberation
#define EMBED_T 6 // different tone
#define EMBED_T 6 // different tone for announcing punctuation
#define EMBED_I 7 // sound icon #define EMBED_I 7 // sound icon
#define EMBED_S2 8 // speed (used in synthesize) #define EMBED_S2 8 // speed (used in synthesize)
#define EMBED_Y 9 // say-as commands #define EMBED_Y 9 // say-as commands
int DoSpect(PHONEME_TAB *this_ph, PHONEME_TAB *prev_ph, PHONEME_TAB *next_ph, int DoSpect(PHONEME_TAB *this_ph, PHONEME_TAB *prev_ph, PHONEME_TAB *next_ph,
int which, PHONEME_LIST *plist, int modulation); int which, PHONEME_LIST *plist, int modulation);
int PauseLength(int pause); int PauseLength(int pause);
int LookupPhonemeTable(const char *name);


void InitBreath(void); void InitBreath(void);

+ 1
- 1
src/tr_english.cpp View File

if(c == '\'') if(c == '\'')
apostrophe = 1; apostrophe = 1;
else else
if((c < 'a') || (c > 0x241))
if(!IsAlpha(c))
return(0); // letter (not vowel) outside Latin character range or apostrophe, abort test return(0); // letter (not vowel) outside Latin character range or apostrophe, abort test
} }
if((vowel_posn > 5) || ((word[0]!='s') && (vowel_posn > 4))) if((vowel_posn > 5) || ((word[0]!='s') && (vowel_posn > 4)))

+ 67
- 10
src/translate.cpp View File



while(*wordx != ' ') while(*wordx != ' ')
{ {
wordx += TranslateLetter(wordx, phonemes,spell_word);
wordx += TranslateLetter(wordx, phonemes,spell_word, word_length);
posn++; posn++;
if(phonemes[0] == phonSWITCH) if(phonemes[0] == phonSWITCH)
{ {
// 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(wordx,phonemes,0);
wordx += TranslateLetter(wordx,phonemes,0, word_length);
posn++; posn++;
if(phonemes[0] == phonSWITCH) if(phonemes[0] == phonSWITCH)
{ {
// characters not recognised, speak them individually // characters not recognised, speak them individually


utf8_in(&wc, wordx, 0); utf8_in(&wc, wordx, 0);
if(!iswpunct(wc))
if((word_length == 1) && IsAlpha(wc))
{ {
posn = 0; posn = 0;
while(*wordx != ' ') while(*wordx != ' ')
{ {
wordx += TranslateLetter(wordx, phonemes, 4);
wordx += TranslateLetter(wordx, phonemes, 4, word_length);
posn++; posn++;
if(phonemes[0] == phonSWITCH) if(phonemes[0] == phonSWITCH)
{ {
int first_phoneme = 1; int first_phoneme = 1;
int source_ix; int source_ix;
int len; int len;
int ix;
int sylimit; // max. number of syllables in a word to be combined with a preceding preposition int sylimit; // max. number of syllables in a word to be combined with a preceding preposition
const char *new_language; const char *new_language;
unsigned char bad_phoneme[4]; unsigned char bad_phoneme[4];
int word_copy_len;
char word_copy[N_WORD_BYTES];


len = wtab->length; len = wtab->length;
if(len > 31) len = 31; if(len > 31) len = 31;
if(word_flags & FLAG_PHONEMES) if(word_flags & FLAG_PHONEMES)
{ {
// The input is in phoneme mnemonics, not language text // The input is in phoneme mnemonics, not language text
EncodePhonemes(word,word_phonemes,bad_phoneme);
int c1;
char lang_name[12];

if(memcmp(word,"_^_",3)==0)
{
// switch languages
word+=3;
for(ix=0;;)
{
c1 = *word++;
if((c1==' ') || (c1==0))
break;
lang_name[ix++] = tolower(c1);
}
lang_name[ix] = 0;

if((ix = LookupPhonemeTable(lang_name)) > 0)
{
SelectPhonemeTable(ix);
word_phonemes[0] = phonSWITCH;
word_phonemes[1] = ix;
word_phonemes[2] = 0;
}
}
else
{
EncodePhonemes(word,word_phonemes,bad_phoneme);
}
flags = FLAG_FOUND; flags = FLAG_FOUND;
} }
else else
{ {
ix = 0;
while((word_copy[ix] = word[ix]) != ' ') ix++;
word_copy_len = ix;

flags = translator->TranslateWord(word, next_pause, wtab); flags = translator->TranslateWord(word, next_pause, wtab);


if((flags & FLAG_ALT2_TRANS) && ((sylimit = langopts.param[LOPT_COMBINE_WORDS]) > 0)) if((flags & FLAG_ALT2_TRANS) && ((sylimit = langopts.param[LOPT_COMBINE_WORDS]) > 0))
if(p[0] == phonSWITCH) if(p[0] == phonSWITCH)
{ {
// this word uses a different language // this word uses a different language
memcpy(word, word_copy, word_copy_len);

new_language = (char *)(&p[1]); new_language = (char *)(&p[1]);
if(new_language[0]==0) if(new_language[0]==0)
new_language = "en"; new_language = "en";


// Add the phonemes to the first stage phoneme list (ph_list2) // Add the phonemes to the first stage phoneme list (ph_list2)
ph = phoneme_tab[ph_code]; ph = phoneme_tab[ph_code];

if(ph_code == phonSWITCH)
{
ph_list2[n_ph_list2].phcode = ph_code;
ph_list2[n_ph_list2].sourceix = 0;
ph_list2[n_ph_list2].synthflags = embedded_flag;
ph_list2[n_ph_list2++].tone_number = *p++;
}
else
if(ph->type == phSTRESS) if(ph->type == phSTRESS)
{ {
// don't add stress phonemes codes to the list, but give their stress // don't add stress phonemes codes to the list, but give their stress


for(j=0; charix[j]==0; j++); for(j=0; charix[j]==0; j++);
words[0].sourceix = charix[j]; words[0].sourceix = charix[j];
for(k=j; charix[k]!=0; k++);
words[0].length = k-j;
k = 0;
while(charix[j] != 0)
{
// count the number of characters (excluding multibyte continuation bytes)
if(charix[j++] != 0xffff)
k++;
}
words[0].length = k;


while(!finished && (ix < (int)sizeof(sbuf))&& (n_ph_list2 < N_PHONEME_LIST-4)) while(!finished && (ix < (int)sizeof(sbuf))&& (n_ph_list2 < N_PHONEME_LIST-4))
{ {
words[word_count].start = ix; words[word_count].start = ix;
words[word_count].flags = 0; words[word_count].flags = 0;


for(j=source_index; charix[j] == 0; j++);
for(j=source_index; charix[j] == 0; j++); // skip blanks
words[word_count].sourceix = charix[j]; words[word_count].sourceix = charix[j];
for(k=j; charix[k]!=0; k++);
words[word_count].length = k-j;
k = 0;
while(charix[j] != 0)
{
// count the number of characters (excluding multibyte continuation bytes)
if(charix[j++] != 0xffff)
k++;
}
words[word_count].length = k;


word_flags = next_word_flags; word_flags = next_word_flags;
next_word_flags = 0; next_word_flags = 0;

+ 3
- 2
src/translate.h View File



private: private:
int TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause); int TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause);
int TranslateLetter(char *letter, char *phonemes, int control);
int TranslateLetter(char *letter, char *phonemes, int control, int word_length);
void SetSpellingStress(char *phonemes, int control, int n_chars); void SetSpellingStress(char *phonemes, int control, int n_chars);
void WriteMnemonic(int *ix, int mnem); void WriteMnemonic(int *ix, int mnem);
void MakePhonemeList(int post_pause, int new_sentence); void MakePhonemeList(int post_pause, int new_sentence);
int AnnouncePunctuation(int c1, int c2, char *buf, int ix); int AnnouncePunctuation(int c1, int c2, char *buf, int ix);


const char *LookupDict2(const char *word, const char *word2, char *phonetic, unsigned int *flags, int end_flags, WORD_TAB *wtab); const char *LookupDict2(const char *word, const char *word2, char *phonetic, unsigned int *flags, int end_flags, WORD_TAB *wtab);
const char *LookupSpecial(const char *string);
const char *LookupSpecial(const char *string, char *text_out);
const char *LookupCharName(int c); const char *LookupCharName(int c);
void LookupLetter(unsigned int letter, int next_byte, char *ph_buf); void LookupLetter(unsigned int letter, int next_byte, char *ph_buf);
int LookupNum2(int value, int control, char *ph_out); int LookupNum2(int value, int control, char *ph_out);
#define N_PUNCTLIST 60 #define N_PUNCTLIST 60
extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters to announce extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters to announce
extern unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS]; extern unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS];
extern const unsigned short punct_chars[]; // punctuation chars fo end-of-clause


extern int speech_parameters[]; extern int speech_parameters[];



+ 11
- 3
src/wavegen.cpp View File

int wcmdq_tail=0; int wcmdq_tail=0;


// pitch,speed, // pitch,speed,
int embedded_default[N_EMBEDDED_VALUES] = {0,50,170,100,50, 0,50, 0,170,0,0,0,0,0};
int embedded_default[N_EMBEDDED_VALUES] = {0,50,170,100,50, 0,0, 0,170,0,0,0,0,0};
static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,360,300,99,99,99, 0,360,0,0,0,0,4}; static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,360,300,99,99,99, 0,360,0,0,0,0,4};


#define N_CALLBACK_IX N_WAV_BUF-2 // adjust this delay to match display with the currently spoken word #define N_CALLBACK_IX N_WAV_BUF-2 // adjust this delay to match display with the currently spoken word
amp = embedded_value[EMBED_H]; amp = embedded_value[EMBED_H];
delay = 130; delay = 130;
} }
if(embedded_value[EMBED_T] > 0)
{
// announcing punctuation
amp = embedded_value[EMBED_T] * 10;
delay = 130;
}


if(delay == 0) if(delay == 0)
amp = 0; amp = 0;


switch(command) switch(command)
{ {
case EMBED_P:
case EMBED_T: case EMBED_T:
WavegenSetEcho(); // and drop through to case P
case EMBED_P:
// adjust formants to give better results for a different voice pitch // adjust formants to give better results for a different voice pitch
if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE) if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE)
pitch_value = MAX_PITCH_VALUE; pitch_value = MAX_PITCH_VALUE;
{ {
wvoice->freq[ix] = (wvoice->freq2[ix] * factor)/256; wvoice->freq[ix] = (wvoice->freq2[ix] * factor)/256;
} }
factor = (embedded_value[EMBED_T] - 50)*2;
factor = embedded_value[EMBED_T]*3;
wvoice->height[0] = (wvoice->height2[0] * (256 - factor*2))/256; wvoice->height[0] = (wvoice->height2[0] * (256 - factor*2))/256;
wvoice->height[1] = (wvoice->height2[1] * (256 - factor))/256; wvoice->height[1] = (wvoice->height2[1] * (256 - factor))/256;
break; break;


if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE) if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE)
pitch_value = MAX_PITCH_VALUE; pitch_value = MAX_PITCH_VALUE;
pitch_value -= embedded_value[EMBED_T]; // adjust tone for announcing punctuation
if(pitch_value < 0) if(pitch_value < 0)
pitch_value = 0; pitch_value = 0;



Loading…
Cancel
Save