eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ph_catalan_ba 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. //====================================================
  2. // Catalan balearic - based on Catalan (and Spanish and Base2)
  3. //====================================================
  4. // plosives (oclusives)
  5. // ====================
  6. // following https://giec.iec.cat/textgramatica/codi/4.2.1
  7. phoneme p
  8. vls blb stp
  9. lengthmod 2
  10. voicingswitch b
  11. Vowelin f1=0 f2=1000 -50 -100 f3=-200 80
  12. Vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=30
  13. IF thisPh(isWordEnd) AND nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  14. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  15. ipa NULL
  16. ELIF nextPh(t) OR nextPh(s) OR nextPh(ts) THEN
  17. ChangePhoneme(t)
  18. ELIF nextPh(g) THEN
  19. ChangePhoneme(g)
  20. ELIF nextPh(Z) THEN
  21. ChangePhoneme(d)
  22. ELIF nextPh(f) THEN
  23. ChangePhoneme(f)
  24. ELIF nextPh(R) OR nextPh(j) THEN
  25. ipa NULL
  26. ELIF nextPh(m) THEN
  27. ChangePhoneme(m)
  28. ELIF nextPh(isVoiced) THEN
  29. ChangePhoneme(b)
  30. ENDIF
  31. ELIF nextPh(isRhotic) THEN
  32. WAV(ustop/pr)
  33. ELIF nextPh(l) THEN
  34. WAV(ustop/pl)
  35. ELIF thisPh(isWordStart) THEN // don't change it if it's word start
  36. ELIF nextPh(isVoiced) AND nextPh(isNotVowel) THEN
  37. ChangePhoneme(b)
  38. ELIF nextPh(t) THEN
  39. ChangePhoneme(t)
  40. ELIF nextPh(s) THEN
  41. IF nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // sonority propagation
  42. ChangePhoneme(d)
  43. ELSE
  44. ChangePhoneme(t)
  45. ENDIF
  46. ENDIF
  47. WAV(ustop/p_unasp)
  48. endphoneme
  49. phoneme t // dental variant of /t/
  50. vls dnt stp
  51. lengthmod 2
  52. voicingswitch d
  53. Vowelin f1=0 f2=1600 -300 300 f3=-100 80
  54. Vowelout f1=0 f2=1600 -300 250 f3=-100 80 rms=20
  55. IF nextPh(isPause2) THEN
  56. WAV(ustop/t_dnt, 30)
  57. ELIF thisPh(isWordEnd) AND nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  58. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  59. ipa NULL
  60. ELIF nextPh(k) THEN
  61. ChangePhoneme(k)
  62. ELIF nextPh(b) THEN
  63. ChangePhoneme(b)
  64. ELIF nextPh(f) THEN
  65. ChangePhoneme(f)
  66. ELIF nextPh(p) THEN
  67. ChangePhoneme(p)
  68. ELIF nextPh(isVoiced) THEN
  69. ChangePhoneme(d)
  70. ENDIF
  71. ELIF nextPh(isWordEnd) AND nextPh(s) THEN
  72. IF next2Ph(k) THEN
  73. ChangePhoneme(k)
  74. ELIF next2Ph(b) THEN
  75. ChangePhoneme(b)
  76. ELIF next2Ph(isVoiced) THEN
  77. ChangePhoneme(d)
  78. ENDIF
  79. ELIF thisPh(isWordStart) THEN // don't change it if it's word start
  80. ELIF nextPh(isVoiced) AND nextPh(isNotVowel) THEN
  81. IF nextPh(**) THEN
  82. ELSE
  83. ChangePhoneme(d)
  84. ENDIF
  85. ELIF nextPh(s) AND nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // sonority propagation
  86. ChangePhoneme(d)
  87. ENDIF
  88. WAV(ustop/t_dnt2, 60)
  89. endphoneme
  90. phoneme k
  91. vls vel stp
  92. lengthmod 2
  93. voicingswitch g
  94. Vowelin f1=0 f2=2300 200 400 f3=-100 80
  95. Vowelout f1=0 f2=2300 300 400 f3=-100 80 rms=20
  96. IF nextPh(isPause2) THEN
  97. WAV(ustop/k_)
  98. ELIF nextPh(isRhotic) THEN
  99. WAV(ustop/kr)
  100. ELIF thisPh(isWordEnd) AND nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  101. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  102. ipa NULL
  103. ELIF nextPh(t) OR nextPh(s) OR nextPh(ts) THEN
  104. ChangePhoneme(t)
  105. ELIF nextPh(isVoiced) THEN
  106. ChangePhoneme(g)
  107. ENDIF
  108. ELIF thisPh(isWordStart) THEN // don't change it if it's word start
  109. ELIF nextPh(isVoiced) AND nextPh(isNotVowel) THEN
  110. IF nextPh(w) THEN
  111. ELIF nextPh(n) OR nextPh(d) OR nextPh(z) THEN
  112. ChangePhoneme(g)
  113. ENDIF
  114. ELIF nextPh(t) OR nextPh(ts) THEN
  115. ChangePhoneme(t)
  116. ELIF nextPh(s) THEN
  117. IF nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // sonority propagation
  118. ChangePhoneme(d)
  119. ELSE
  120. ChangePhoneme(t)
  121. ENDIF
  122. ENDIF
  123. WAV(ustop/k_unasp, 70)
  124. endphoneme
  125. phoneme b
  126. vcd blb stp
  127. IF thisPh(isWordEnd) THEN
  128. IF nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  129. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  130. ipa NULL
  131. ELIF NOT nextPh(isVoiced) THEN
  132. ChangePhoneme(p)
  133. ENDIF
  134. ELSE
  135. ChangePhoneme(p)
  136. ENDIF
  137. ELIF nextPh(s) AND nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // keep sonority
  138. ELIF nextPh(s) OR nextPh(t) THEN
  139. ChangePhoneme(t)
  140. ELIF nextPh(isVoiced) THEN
  141. IF nextPh(isVowel) OR nextPh(isRhotic) OR nextPh(l) OR nextPh(j) OR nextPh(w) THEN
  142. IF prevPh(isVowel) OR prevPh(isLiquid) OR prevPh(isVFricative) THEN
  143. ChangePhoneme(B)
  144. ENDIF
  145. ENDIF
  146. ELSE
  147. ChangePhoneme(p)
  148. ENDIF
  149. CALL base1/b
  150. endphoneme
  151. phoneme g
  152. vcd vel stp
  153. lengthmod 5
  154. voicingswitch k
  155. Vowelin f1=2 f2=2300 200 300 f3=-300 80
  156. Vowelout f1=2 f2=2300 250 300 f3=-300 80 brk
  157. IF thisPh(isWordEnd) THEN
  158. IF nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  159. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  160. ipa NULL
  161. ELIF nextPh(s) AND nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // keep sonority
  162. ELIF NOT nextPh(isVoiced) THEN
  163. ChangePhoneme(k)
  164. ENDIF
  165. ELSE
  166. ChangePhoneme(k)
  167. ENDIF
  168. ELIF nextPh(isVoiced) THEN
  169. IF nextPh(m) THEN
  170. ChangePhoneme(m)
  171. ELIF nextPh(d) THEN
  172. ChangePhoneme(g)
  173. ELIF nextPh(isVowel) OR nextPh(isRhotic) OR nextPh(l) OR nextPh(j) OR nextPh(w) THEN
  174. IF prevPh(isVowel) OR prevPh(isLiquid) OR prevPh(isVFricative) THEN
  175. ChangePhoneme(Q)
  176. ENDIF
  177. ENDIF
  178. ELSE
  179. ChangePhoneme(k)
  180. ENDIF
  181. IF PreVoicing THEN
  182. FMT(g/xg)
  183. ENDIF
  184. IF nextPh(isPause2) THEN
  185. FMT(g/g_) addWav(x/g_)
  186. ENDIF
  187. FMT(g/g) addWav(x/g2) // weaker [g]
  188. endphoneme
  189. phoneme d
  190. vcd dnt stp
  191. IF thisPh(isWordEnd) AND nextPh(isNotVowel) AND NOT nextPh(isPause) THEN
  192. IF prevPh(isNasal) OR prevPh(isLiquid) OR prevPh(R) OR prevPh(**) OR prevPh(j) THEN
  193. ipa NULL
  194. ELIF nextPh(p) THEN
  195. ChangePhoneme(p)
  196. ELIF NOT nextPh(isVoiced) THEN
  197. ChangePhoneme(t)
  198. ENDIF ELIF nextPh(s) AND nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // keep sonority
  199. ELIF nextPh(isVoiced) THEN
  200. IF nextPh(m) THEN
  201. ChangePhoneme(m)
  202. ELIF nextPh(isVowel) OR nextPh(isRhotic) OR nextPh(l) OR nextPh(j) OR nextPh(w) THEN
  203. IF prevPh(isVowel) OR prevPh(**) OR prevPh(R) OR prevPh(j) OR prevPh(w) OR prevPh(s) OR prevPh(z) THEN
  204. ChangePhoneme(D)
  205. ENDIF
  206. ENDIF
  207. ELSE
  208. ChangePhoneme(t)
  209. ENDIF
  210. CALL base2/d
  211. endphoneme
  212. // vowels
  213. //=====================================================
  214. phoneme e
  215. vwl starttype #e endtype #e
  216. length 170
  217. IF thisPh(isUnstressed) THEN
  218. ChangePhoneme(@)
  219. ENDIF
  220. FMT(vowel/e)
  221. endphoneme
  222. phoneme O
  223. vwl starttype #o endtype #o
  224. length 170
  225. IF thisPh(isWordEnd) THEN
  226. IF nextPh(o) OR nextPh(O) THEN
  227. ipa NULL
  228. ELSE
  229. ChangeIfUnstressed(o)
  230. ENDIF
  231. ELIF thisPh(isUnstressed) THEN
  232. ChangePhoneme(o)
  233. ENDIF
  234. FMT(vowel/oo)
  235. endphoneme
  236. phoneme o
  237. vwl starttype #o endtype #o
  238. length 170
  239. FMT(vowel/o)
  240. endphoneme
  241. phoneme @ // Schwa, e.g. alph**a**
  242. vwl starttype #@ endtype #@
  243. length 140
  244. FMT(vowel/@)
  245. endphoneme
  246. // fricatives
  247. // ====================================
  248. phoneme v
  249. vcd lbd frc
  250. voicingswitch f
  251. lengthmod 6
  252. Vowelin f1=0 f2=1000 -300 -200 f3=-300 100
  253. Vowelout f1=0 f2=1000 -500 -300 f3=-300 60 len=50
  254. IF thisPh(isWordEnd) AND prevPh(**) AND nextPh(isNotVowel) THEN
  255. ipa NULL
  256. ENDIF
  257. IF KlattSynth THEN
  258. Vowelout f1=1 f2=1000 -500 -300 f3=-300 60 len=50 brk
  259. IF nextPh(isPause2) THEN
  260. FMT(klatt/v_) addWav(vocw/v)
  261. ENDIF
  262. FMT(klatt/v) addWav(vocw/v, 150)
  263. ENDIF
  264. IF nextPh(isPause2) THEN
  265. FMT(voc/v_) addWav(vocw/v)
  266. ENDIF
  267. IF thisPh(isWordStart) AND nextPhW(isLiquid) THEN
  268. length 70
  269. ENDIF
  270. FMT(voc/v) addWav(vocw/v)
  271. endphoneme
  272. phoneme f
  273. vls lbd frc
  274. voicingswitch v
  275. lengthmod 3
  276. Vowelout f1=0 f2=1000 -500 -350 f3=-200 80
  277. IF thisPh(isWordEnd)THEN
  278. IF prevPh(**) THEN
  279. ipa NULL
  280. ELIF nextPh(isVoiced) THEN
  281. ipa v
  282. ENDIF
  283. ELIF nextPh(s) THEN
  284. IF nextPh(isWordEnd) AND next2Ph(isVoiced) THEN // sonority propagation
  285. ChangePhoneme(d)
  286. ELSE
  287. ChangePhoneme(t)
  288. ENDIF
  289. ENDIF
  290. IF nextPh(isPause) THEN
  291. WAV(ufric/f_)
  292. ENDIF
  293. WAV(ufric/f)
  294. endphoneme
  295. // liquid
  296. // =====================================
  297. phoneme ** // "cara"
  298. liquid alv rhotic
  299. ipa ɾ
  300. lengthmod 3
  301. Vowelout f1=3 f2=1600 -300 300 f3=-300 80 rms=35 len=15
  302. Vowelin f1=2 f2=1600 -300 300 f3=-100 80 len=20
  303. IF nextPh(isWordEnd) AND nextPh(isNasal) THEN
  304. ipa NULL
  305. ENDIF
  306. IF prevPh(#i) OR prevPh(#e) THEN
  307. FMT(r3/@tap2)
  308. ENDIF
  309. FMT(r3/@tap)
  310. endphoneme
  311. phoneme l^ // "calla"
  312. liquid
  313. ipa ʎ
  314. lengthmod 7
  315. Vowelout len=60 lenadd rate
  316. length 100
  317. NextVowelStarts
  318. VowelStart(l^/j2@)
  319. VowelStart(l^/j2a)
  320. VowelStart(l^/j2e)
  321. VowelStart(l^/j2i)
  322. VowelStart(l^/j2o)
  323. VowelStart(l^/j2u)
  324. EndSwitch
  325. IF prevPh(isPause) THEN
  326. FMT(l^/_l^)
  327. ELIF prevPh(isVowel) THEN
  328. IF nextPh(isPause) THEN
  329. ChangePhoneme(j)
  330. ELIF nextPh(s) AND next2Ph(isPause) THEN
  331. ChangePhoneme(j)
  332. ELIF nextPh(isVowel) AND NOT thisPh(isWordEnd) AND NOT thisPh(isWordStart) THEN
  333. IF nextPh(isStressed) THEN
  334. IF nextPh(i) OR nextPh(e) THEN
  335. ipa NULL
  336. ELSE
  337. ChangePhoneme(j)
  338. ENDIF
  339. ELIF prevPh(isStressed) THEN
  340. IF prevPh(i) OR prevPh(e) THEN
  341. ipa NULL
  342. ELSE
  343. ChangePhoneme(j)
  344. ENDIF
  345. ELSE
  346. ChangePhoneme(j)
  347. ENDIF
  348. ENDIF
  349. ENDIF
  350. FMT(l^/l^)
  351. endphoneme
  352. // fricatives
  353. //================================0
  354. phoneme s // dissimilation
  355. vls alv frc sib
  356. voicingswitch z
  357. lengthmod 3
  358. Vowelin f1=0 f2=1700 -300 300 f3=-100 80
  359. Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20
  360. IF thisPh(isWordEnd) AND nextPh(isVoiced) THEN
  361. ChangePhoneme(z)
  362. ELIF thisPh(isWordStart) THEN
  363. IF prevPh(t) THEN
  364. ChangePhoneme(ts)
  365. ENDIF
  366. ENDIF
  367. IF nextPh(isPause) THEN
  368. WAV(ufric/s_)
  369. ELIF nextPh(p) OR nextPh(t) OR nextPh(k) THEN
  370. WAV(ufric/s!)
  371. ENDIF
  372. WAV(ufric/s)
  373. endphoneme
  374. // nasals
  375. // ===========================
  376. phoneme m
  377. vcd blb nas
  378. Vowelout f1=2 f2=1000 -500 -350 f3=-200 80 brk
  379. lengthmod 4
  380. IF KlattSynth THEN
  381. Vowelin f1=0 f2=1000 -50 -200 f3=-200 80
  382. IF nextPh(isPause2) THEN
  383. FMT(klatt/m_)
  384. ENDIF
  385. FMT(klatt/m)
  386. ENDIF
  387. NextVowelStarts
  388. VowelStart(m/m@)
  389. VowelStart(m/ma)
  390. VowelStart(m/me)
  391. VowelStart(m/mi)
  392. VowelStart(m/mo)
  393. VowelStart(m/mu)
  394. EndSwitch
  395. IF nextPh(f) OR nextPh(v) THEN
  396. ChangePhoneme(M)
  397. ELIF nextPh(t) OR nextPh(d) OR nextPh(s) OR nextPh(z) OR nextPh(R) OR nextPh(S) OR nextPh(Z) THEN
  398. ChangePhoneme(n)
  399. ELIF nextPh(l^) OR nextPh(n^) THEN
  400. ChangePhoneme(n^)
  401. ELIF nextPh(k) OR nextPh(g) THEN
  402. ChangePhoneme(N)
  403. ELIF thisPh(isWordEnd) THEN
  404. IF nextPh(j) THEN
  405. ChangePhoneme(j)
  406. ELIF nextPh(l) THEN
  407. ChangePhoneme(l)
  408. ENDIF
  409. ENDIF
  410. IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
  411. FMT(m/mj)
  412. ELIF prevPh(isPause) THEN
  413. FMT(m/_m)
  414. ELIF nextPh(isNotVowel) THEN
  415. FMT(m/m_)
  416. ENDIF
  417. endphoneme
  418. phoneme n
  419. vcd alv nas
  420. Vowelout f1=2 f2=1500 -300 250 f3=-100 80 rms=20 brk
  421. lengthmod 4
  422. IF KlattSynth THEN
  423. Vowelin f1=0 f2=1500 -200 200 f3=0 80
  424. FMT(klatt/n)
  425. ENDIF
  426. NextVowelStarts
  427. VowelStart(n/n@)
  428. VowelStart(n/na)
  429. VowelStart(n/ne)
  430. VowelStart(n/ni)
  431. VowelStart(n/no)
  432. VowelStart(n/nu)
  433. EndSwitch
  434. IF nextPh(f) OR nextPh(v) THEN
  435. ChangePhoneme(M)
  436. ELIF nextPh(k) OR nextPh(g) THEN
  437. ChangePhoneme(N)
  438. ELIF nextPh(p) OR nextPh(b) OR nextPh(v) OR nextPh(m) THEN
  439. ChangePhoneme(m)
  440. ELIF thisPh(isWordEnd) THEN
  441. IF nextPh(l^) OR nextPh(n^) THEN
  442. ChangePhoneme(n^)
  443. ELIF nextPh(j) THEN
  444. ChangePhoneme(j)
  445. ENDIF
  446. ENDIF
  447. IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
  448. FMT(n/nj)
  449. ELIF prevPh(isPause) OR prevPh(n) THEN
  450. FMT(n/_n)
  451. ELIF nextPh(isNotVowel) THEN
  452. FMT(n/n_)
  453. ENDIF
  454. endphoneme