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_vietnam 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. //====================================================
  2. // Vietnamese Phonemes
  3. //====================================================
  4. phoneme 1 // ngang tone: level
  5. stress
  6. Tone(30, 28, envelope/p_level, NULL) // 28 29
  7. endphoneme
  8. phoneme 2 // huyền tone: low falling
  9. stress
  10. Tone(20, 8, envelope/p_fall, NULL) //20 8
  11. endphoneme
  12. phoneme 3 // sắc Tone(rising
  13. stress
  14. Tone(30, 55, envelope/p_rise, NULL) // 30 60
  15. endphoneme
  16. phoneme 4 // hỏi Tone(curve (dipping rising)
  17. stress
  18. Tone(10, 31, envelope/p_fallrise, NULL) //33 31
  19. endphoneme
  20. phoneme 5 // ngã tone: broken (creaking rising)
  21. stress
  22. Tone(34, 60,envelope/p_214, envelope/vi_5amp) // 28,58 20 80
  23. endphoneme
  24. phoneme 6 // nặng Tone(drop (constricted)
  25. stress
  26. //length 150 // ignore because it make too short sound 75 // reduce the length of the vowel
  27. Tone(34, 10, envelope/p_512, envelope/vi_6amp) //40 20
  28. endphoneme
  29. phoneme 7 // Tone(1 (ngang) at end of clause
  30. stress
  31. Tone(30, 28, envelope/p_fall, NULL) //40 20
  32. endphoneme
  33. // Vowels
  34. //=======
  35. phoneme a
  36. vwl starttype #@ endtype #@
  37. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  38. length 240
  39. ELSE
  40. length 180
  41. ENDIF
  42. IF nextPh(N) OR nextPh(c) THEN
  43. FMT(vnasal/a_n)
  44. ELSE
  45. FMT(vietnam/a, 60) //a_4)
  46. //FMT(vietnam/a_x)
  47. ENDIF
  48. endphoneme
  49. phoneme a:
  50. vwl starttype #a endtype #a
  51. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd)THEN
  52. length 240
  53. ELIF nextPh(n^) OR nextPh(c) THEN
  54. length 100
  55. ELIF nextPh(N) THEN
  56. length 200
  57. ELSE
  58. length 180 //200
  59. ENDIF
  60. FMT(vowel/a_8)
  61. //FMT(vietnam/a_2)
  62. endphoneme
  63. phoneme E
  64. vwl starttype #e endtype #e
  65. IF nextPhW(p) THEN
  66. length 143
  67. ELIF nextPhW(t) THEN
  68. length 107
  69. ELIF nextPhW(c) THEN
  70. length 141
  71. ELIF nextPhW(m) THEN
  72. length 128
  73. ELIF nextPhW(n) THEN
  74. length 160
  75. ELIF nextPhW(N) THEN
  76. length 187
  77. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  78. length 240
  79. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordStart) THEN
  80. length 240
  81. ELSE
  82. length 180
  83. ENDIF
  84. FMT(vowel/e_e) //ee_3)
  85. endphoneme
  86. phoneme e
  87. vwl starttype #e endtype #e
  88. IF nextPhW(p) THEN
  89. length 114
  90. ELIF nextPhW(t) THEN
  91. length 126
  92. ELIF nextPhW(c) THEN
  93. length 140
  94. ELIF nextPhW(n^) THEN
  95. length 120
  96. ELIF nextPhW(m) THEN
  97. length 148
  98. ELIF nextPhW(n) THEN
  99. length 163
  100. ELIF nextPhW(N) THEN
  101. length 115
  102. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  103. length 240
  104. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordStart) THEN
  105. length 240
  106. ELSE
  107. length 180
  108. ENDIF
  109. IF nextPh(n^) THEN
  110. FMT(vowel/e)
  111. ELSE
  112. FMT(vietnam/e)
  113. ENDIF
  114. endphoneme
  115. phoneme i
  116. vwl starttype #i endtype #i
  117. IfNextVowelAppend(;)
  118. IF prevPhW(w) THEN
  119. VowelStart(w/wi)
  120. ENDIF
  121. IF nextPhW(p) THEN
  122. length 131
  123. ELIF nextPhW(t) THEN
  124. length 113
  125. ELIF nextPhW(c) OR nextPhW(n^) THEN
  126. length 72
  127. ELIF nextPhW(m) THEN
  128. length 120
  129. ELIF nextPhW(n) THEN
  130. length 128
  131. ELIF nextPhW(N) THEN
  132. length 97
  133. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  134. length 240
  135. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordStart) THEN
  136. length 240
  137. ELSE
  138. length 180
  139. ENDIF
  140. IF nextPh(n^) OR nextPh(c) THEN
  141. FMT(vnasal/ii_n)
  142. ELSE
  143. FMT(vowel/i_4)
  144. ENDIF
  145. endphoneme
  146. phoneme O
  147. vwl starttype #o endtype #o
  148. IF nextPh(kh) OR nextPh(N) THEN
  149. length 80
  150. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  151. length 240
  152. ELSE
  153. length 180
  154. ENDIF
  155. FMT(vdiph2/o_oo) //vowel/oo)
  156. endphoneme
  157. phoneme O+
  158. vwl starttype #o endtype #o
  159. IF nextPh(kh) OR nextPh(N) THEN
  160. length 80
  161. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  162. length 240
  163. ELSE
  164. length 180
  165. ENDIF
  166. FMT(vowel/o) //vowel/oo)
  167. endphoneme
  168. phoneme o
  169. vwl starttype #o endtype #o
  170. IF nextPh(kh) OR nextPh(N) THEN
  171. length 110
  172. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  173. length 240
  174. ELSE
  175. length 180
  176. ENDIF
  177. FMT(vowel/o) // o_2)
  178. endphoneme
  179. phoneme u
  180. vwl starttype #u endtype #u
  181. IF nextPhW(N) OR nextPhW(c) OR nextPhW(t[) THEN
  182. length 80
  183. ELIF nextPhW(m) THEN
  184. length 177
  185. ELIF nextPhW(n) THEN
  186. length 141
  187. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  188. length 240
  189. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordStart) AND NOT nextPhW(N) AND NOT nextPhW(c) AND NOT nextPhW(t[) THEN
  190. length 240
  191. ELSE
  192. length 120
  193. ENDIF
  194. FMT(vnasal/u_n) //vowel/u_5)
  195. endphoneme
  196. phoneme y
  197. vwl starttype #u endtype #u
  198. IF nextPh(kh) OR nextPh(N) THEN
  199. length 120
  200. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  201. length 240
  202. ELSE
  203. length 180
  204. ENDIF
  205. FMT(vowel/u#_5)
  206. endphoneme
  207. phoneme @
  208. vwl starttype #@ endtype #a
  209. IF nextPh(kh) OR nextPh(N) OR nextPh(n^) OR nextPh(c) THEN
  210. length 120
  211. ELIF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  212. length 240
  213. ELSE
  214. length 180
  215. ENDIF
  216. // FMT(vowel/V) //vowel/@_2)
  217. FMT(vietnam/V)
  218. endphoneme
  219. phoneme @:
  220. vwl starttype #@ endtype #@
  221. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  222. length 240
  223. ELSE
  224. length 180
  225. ENDIF
  226. FMT(vowel/@_2)
  227. endphoneme
  228. // Diphthongs
  229. //===========
  230. phoneme aI
  231. vwl starttype #a endtype #i
  232. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  233. length 240
  234. ELSE
  235. length 200
  236. ENDIF
  237. FMT(vdiph/&i_2)
  238. endphoneme
  239. phoneme a:I
  240. vwl starttype #a endtype #i
  241. length 240 //250
  242. FMT(vdiph/ai)
  243. endphoneme
  244. phoneme @I
  245. vwl starttype #@ endtype #i
  246. length 240 //250
  247. FMT(vdiph/@i)
  248. endphoneme
  249. phoneme @:I
  250. vwl starttype #@ endtype #i
  251. length 240 //250
  252. FMT(vdiph/y#i)
  253. endphoneme
  254. phoneme eI
  255. vwl starttype #e endtype #i
  256. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  257. length 240
  258. ELSE
  259. length 200
  260. ENDIF
  261. FMT(vdiph/ei)
  262. endphoneme
  263. phoneme EI
  264. vwl starttype #e endtype #i
  265. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  266. length 240
  267. ELSE
  268. length 200
  269. ENDIF
  270. FMT(vdiph/eei)
  271. endphoneme
  272. phoneme OI
  273. vwl starttype #o endtype #i
  274. length 240
  275. FMT(vdiph/ooi_4)
  276. endphoneme
  277. phoneme oI
  278. vwl starttype #o endtype #i
  279. length 240
  280. FMT(vdiph/oi)
  281. endphoneme
  282. phoneme uI
  283. vwl starttype #u endtype #i
  284. length 240
  285. FMT(vdiph/ui)
  286. endphoneme
  287. phoneme yI
  288. vwl starttype #u endtype #i
  289. length 240
  290. FMT(vdiph/u-i)
  291. endphoneme
  292. phoneme aU
  293. vwl starttype #a endtype #u
  294. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  295. length 240
  296. ELSE
  297. length 200
  298. ENDIF
  299. FMT(vdiph/aau_4)
  300. endphoneme
  301. phoneme a:U
  302. vwl starttype #a endtype #u
  303. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  304. length 240
  305. ELSE
  306. length 200
  307. ENDIF
  308. FMT(vdiph/au)
  309. endphoneme
  310. phoneme eU
  311. vwl starttype #e endtype #u
  312. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  313. length 240
  314. ELSE
  315. length 200
  316. ENDIF
  317. FMT(vdiph/eu)
  318. endphoneme
  319. phoneme EU
  320. vwl starttype #e endtype #u
  321. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  322. length 240
  323. ELSE
  324. length 200
  325. ENDIF
  326. FMT(vdiph/eeu)
  327. endphoneme
  328. phoneme iU
  329. vwl starttype #i endtype #u
  330. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  331. length 240
  332. ELSE
  333. length 200
  334. ENDIF
  335. FMT(vdiph2/iu)
  336. endphoneme
  337. phoneme @U
  338. vwl starttype #@ endtype #u
  339. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  340. length 240
  341. ELSE
  342. length 200
  343. ENDIF
  344. FMT(vdiph/@u_3)
  345. endphoneme
  346. phoneme @:U
  347. vwl starttype #@ endtype #u
  348. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  349. length 240
  350. ELSE
  351. length 200
  352. ENDIF
  353. FMT(vdiph/@u)
  354. endphoneme
  355. phoneme i@
  356. vwl starttype #i endtype #@
  357. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  358. length 240
  359. ELSE
  360. length 200
  361. ENDIF
  362. FMT(vdiph2/ii@_3)
  363. endphoneme
  364. phoneme y@
  365. vwl starttype #i endtype #@
  366. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  367. length 240
  368. ELSE
  369. length 200
  370. ENDIF
  371. FMT(vdiph2/y-y#)
  372. endphoneme
  373. phoneme u@
  374. vwl starttype #u endtype #@
  375. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  376. length 240
  377. ELSE
  378. length 200
  379. ENDIF
  380. FMT(vdiph2/uu@)
  381. endphoneme
  382. // Addition Dipthongs
  383. phoneme o# // ông
  384. vwl starttype #o endtype #o
  385. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  386. length 240
  387. ELSE
  388. length 200
  389. ENDIF
  390. FMT(vnasal/a#u_n)
  391. endphoneme
  392. phoneme O# // ong
  393. vwl starttype #o endtype #o
  394. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  395. length 240
  396. ELIF nextPh(k) THEN
  397. length 140
  398. ELSE
  399. length 200
  400. ENDIF
  401. FMT(vnasal/&u_n)
  402. endphoneme
  403. phoneme o@
  404. vwl starttype #o endtype #a
  405. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  406. length 240
  407. ELSE
  408. length 200
  409. ENDIF
  410. FMT(vdiph2/oa)
  411. endphoneme
  412. phoneme o&
  413. vwl starttype #o endtype #o
  414. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  415. length 240
  416. ELSE
  417. length 200
  418. ENDIF
  419. FMT(vietnam/oe)
  420. endphoneme
  421. phoneme iE // iê : viết, giệc
  422. vwl starttype #i endtype #e
  423. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  424. length 240
  425. ELSE
  426. length 200
  427. ENDIF
  428. FMT(vietnam/ie_2)
  429. endphoneme
  430. phoneme Oi // oai sound
  431. vwl starttype #o endtype #i
  432. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  433. length 240
  434. ELSE
  435. length 200
  436. ENDIF
  437. FMT(vdiph/ooi_3)
  438. endphoneme
  439. // Vowel and Dipthong for south dialect
  440. phoneme O- // ôi southern sound
  441. vwl starttype #o endtype #i
  442. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  443. length 240
  444. ELSE
  445. length 180
  446. ENDIF
  447. FMT(vnasal/oi_n)
  448. endphoneme
  449. phoneme @- // ơi southern sound
  450. vwl starttype #o endtype #i
  451. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  452. length 240
  453. ELSE
  454. length 180
  455. ENDIF
  456. FMT(vdiph/@i_3)
  457. endphoneme
  458. phoneme u- // u southern sound
  459. vwl starttype #u endtype #u
  460. IF thisPh(isFirstVowel) AND thisPh(isFinalVowel) AND thisPh(isWordEnd) THEN
  461. length 240
  462. ELSE
  463. length 180
  464. ENDIF
  465. FMT(vowel/u_3,70)
  466. endphoneme
  467. phoneme kh
  468. vls vel frc
  469. lengthmod 3
  470. Vowelin f1=0 f2=2300 200 400 f3=200 80 len=30
  471. Vowelout f1=0 f2=2300 300 400 f3=200 80 rms=20
  472. WAV(ustop/k_unasp) //ufric/x, 50)
  473. endphoneme
  474. phoneme k
  475. vls vel frc
  476. lengthmod 3
  477. Vowelin f1=0 f2=2300 200 400 f3=200 80 len=30
  478. Vowelout f1=0 f2=2300 300 400 f3=200 80 rms=20
  479. WAV(ustop/c)
  480. endphoneme
  481. phoneme N // si**ng**
  482. vcd lbv nas
  483. Vowelout f1=3 f2=2300 300 400 f3=-200 80 len=40 rms=20 brk
  484. lengthmod 12 // longer than 'n'
  485. FMT(n/nm)
  486. endphoneme
  487. phoneme l
  488. liquid
  489. Vowelin f1=0 f2=1700 -300 300 f3=-100 80 len=15
  490. //lengthmod 7
  491. //IF nextPh(isNotVowel) THEN
  492. // ChangePhoneme(l/2)
  493. //ENDIF
  494. //CALL vowelstart_l
  495. FMT(l/l_vi)
  496. endphoneme
  497. phoneme t
  498. vls alv stp
  499. //voicingswitch d
  500. lengthmod 2
  501. Vowelin f1=0 f2=1700 -300 300 f3=-100 80 len=15
  502. Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20
  503. WAV(vietnam/th, 50)
  504. endphoneme
  505. phoneme cr
  506. vls pla afr sib
  507. //voicingswitch dZ
  508. lengthmod 2
  509. Vowelin f1=0 f2=2300 200 400 f3=-100 80 len=15
  510. WAV(vietnam/tr,10)
  511. endphoneme
  512. phoneme d_
  513. vcd alv stp
  514. // lengthmod 5
  515. ipa ɗ
  516. length 50
  517. Vowelin f1=1 f2=1700 -300 300 f3=-100 80 len=15
  518. Vowelout f1=2 f2=1700 -300 300 f3=-100 80 brk len=30
  519. WAV(vietnam/dd)
  520. endphoneme
  521. phoneme c
  522. vls pal stp pzd
  523. //voicingswitch J
  524. lengthmod 2
  525. length 50
  526. Vowelin f1=0 f2=2700 400 600 f3=300 80 len=15 brk
  527. Vowelout f1=1 f2=2700 400 600 f3=200 70 len=15 colr=1
  528. WAV(vietnam/ch,5)
  529. endphoneme
  530. phoneme p
  531. vls blb stp
  532. lengthmod 2
  533. Vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11
  534. Vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=22
  535. WAV(ustop/p_unasp_,10)
  536. endphoneme
  537. phoneme t[ // dental variant of /t/
  538. IF thisPh(isWordEnd) THEN
  539. vls alv stp
  540. voicingswitch d
  541. lengthmod 2
  542. length 5
  543. Vowelin f1=1 f2=1500 -250 250 f3=-100 80 amp=16 len=15
  544. Vowelout f1=0 f2=1500 -300 250 f3=-100 80 rms=20 len=15
  545. WAV(ustop/t, 50)
  546. ELSE
  547. vls dnt stp
  548. voicingswitch d[
  549. lengthmod 2
  550. length 5
  551. Vowelin f1=1 f2=1500 -250 250 f3=-100 80 amp=16 len=15
  552. Vowelout f1=0 f2=1500 -300 250 f3=-100 80 rms=20 len=15
  553. IF nextPh(isPause2) THEN
  554. WAV(ustop/t_unasp2, 5)
  555. ENDIF
  556. WAV(ustop/t_hi, 70)
  557. ENDIF
  558. endphoneme
  559. phoneme w
  560. liquid
  561. lengthmod 7
  562. starttype #u
  563. IF nextPh(isVowel) THEN
  564. NextVowelStarts
  565. VowelStart(w/w@)
  566. VowelStart(w/wa)
  567. VowelStart(w/we)
  568. VowelStart(w/wi)
  569. VowelStart(w/wo)
  570. VowelStart(w/wu)
  571. EndSwitch
  572. VowelEnding(w/xw, -30)
  573. IF nextPh(isVowel) AND prevPhW(t[) THEN
  574. FMT(vnasal/u_n, 60)
  575. ENDIF
  576. IF prevPhW(isNasal) THEN
  577. FMT(w/w)
  578. ELSEIF prevPhW(h) THEN
  579. // none, [hw]
  580. ELSE
  581. FMT(w/_w)
  582. ENDIF
  583. ELSE
  584. // no vowel follows
  585. Vowelout len=50
  586. IF prevPh(#i) THEN
  587. FMT(w/iw_)
  588. ENDIF
  589. FMT(w/w_)
  590. ENDIF
  591. endphoneme