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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. // PB General rules for vowels:
  2. // Short vowels
  3. // ACC: Short "pille" [p?el@-], "andre" [AndRV]
  4. // AC[V]: Short "piler" [p?ilV] - verbs, not nouns, which is a problem
  5. // A[N]: Short "bange" [b?AN@-]
  6. // Long vowels
  7. // A + @- OR V: Long "ae" "aer" [&:@-]
  8. // AC + @- OR V: Long "pile" [pi:l@-]
  9. // AC[i]: Long "smidig" [smi:Di]
  10. // Change the length of short vowels (?+vowel)
  11. procedure ShortVowelLength
  12. // "endelig" - Short initial vowel sounds too short
  13. IF thisPh(isWordStart) THEN
  14. length 160
  15. RETURN
  16. ENDIF
  17. // "slutte" t/d + @- makes the u too long
  18. IF next2PhW(@-) THEN
  19. IF nextPhW(t) OR nextPhW(d) THEN
  20. //length 100
  21. LengthAdd -50
  22. // Don't shorten it further if it comes after an "r" sound
  23. // Exit the procedure
  24. RETURN
  25. ENDIF
  26. ENDIF
  27. // "bygget" - consonant + [@-D] makes the vowel too long
  28. IF next2PhW(@-) THEN
  29. IF next3PhW(t) OR next3PhW(d) OR next3PhW(D) THEN
  30. LengthAdd -50
  31. // Don't shorten it further if it comes after an "r" sound ("brygget")
  32. // Exit the procedure
  33. RETURN
  34. ENDIF
  35. ENDIF
  36. // "bygger" - consonant + [V] makes the vowel too long
  37. IF nextPhW(isNotVowel) AND next2PhW(V) THEN
  38. LengthAdd -50
  39. // Don't shorten it further if it comes after an "r" sound ("brygger")
  40. // Exit the procedure
  41. RETURN
  42. ENDIF
  43. // "rigtigt", "fred", "frem", "centralen" - R makes the vowel too long
  44. IF prevPhW(R) OR prevPhW(3-) OR prevPhW(r) THEN
  45. // length 100
  46. LengthAdd -50
  47. ENDIF
  48. // "ring", "ringe", "fængsel"
  49. IF nextPhW(N) THEN
  50. // length 100
  51. LengthAdd -10
  52. ENDIF
  53. // "sigte" t/d + @- makes the vowel too long
  54. IF nextPhW(isNotVowel) AND next2PhW(t) OR next2PhW(d) THEN
  55. IF next3PhW(@-) THEN
  56. // length 100
  57. LengthAdd -50
  58. ENDIF
  59. ENDIF
  60. endprocedure
  61. // Change the length of normal vowels (without ? in front of them)
  62. procedure LongVowelLength
  63. // "alene" - Short initial vowel sounds too short at length 140
  64. IF thisPh(isWordStart) THEN
  65. length 160
  66. RETURN
  67. ENDIF
  68. // "forlade" - [D@-] makes the vowel too long
  69. IF nextPhW(D) AND next2PhW(@-) THEN
  70. length 180
  71. RETURN
  72. ENDIF
  73. // PB long vowel followed by [@-] or [V](vowel+vowel) - "pigen" [p'i@-n]
  74. IF nextPhW(@-) OR nextPhW(V) THEN
  75. length 225
  76. ENDIF
  77. // PB "enig", "enige", "evig", "stædig" - vowel+consolant+[i]
  78. IF nextPhW(isNotVowel) AND next2PhW(i) THEN
  79. length 225
  80. ENDIF
  81. // "ræve", "dele", "mene", "røve", "møve"
  82. IF nextPhW(isNotVowel) AND next2PhW(@-) OR next2PhW(3) OR next3PhW(@-) THEN
  83. length 225
  84. ENDIF
  85. // "vilje", "nedladende" [n'eDl&D@-n@-], "delte" - short followed by 2 consonants
  86. IF nextPhW(isNotVowel) AND next2PhW(isNotVowel) THEN
  87. // Don't make "møve" [m'Ww_!@-_!] short
  88. IF NOT next2PhW(_!) THEN
  89. length 140
  90. ENDIF
  91. ENDIF
  92. // "bryde", "bryder", "strålen", "henrivende" R makes the vowel too long
  93. IF prevPhW(R) OR prevPhW(3-) OR prevPhW(r) THEN
  94. IF next2PhW(@-) OR next2PhW(V) THEN
  95. // length 180
  96. LengthAdd -70
  97. ENDIF
  98. ENDIF
  99. // "syste", "sylte" t/d/D + @- makes the vowel too long
  100. // "international", - added [V] TEST
  101. IF nextPhW(isNotVowel) AND next2PhW(t) OR next2PhW(d) OR next2PhW(D) THEN
  102. IF next3PhW(@-) OR next3PhW(V) THEN
  103. length 110
  104. ENDIF
  105. ENDIF
  106. // "glimrende" [l/3] makes the following vowel too long
  107. // LengthAdd doesn't work here. The length could be 225 or 140 - 30
  108. IF prevPhW(l/3) THEN
  109. // LengthAdd -30
  110. length 110
  111. ENDIF
  112. // "længe" - short - 2 consonants => 1 consonant (ng => [N])
  113. IF nextPhW(N) THEN
  114. length 140
  115. ENDIF
  116. endprocedure
  117. // A bit longer than [@-]
  118. phoneme @
  119. vowel starttype #@ endtype #@
  120. unstressed
  121. length 60
  122. FMT(vowel/@_3)
  123. endphoneme
  124. phoneme @- // very short schwa
  125. vowel starttype #@ endtype #@
  126. unstressed nonsyllabic
  127. ipa ə
  128. IF nextPhW(*) OR nextPhW(r) THEN
  129. ipa NULL // @-* is used to make 'r'
  130. ENDIF
  131. length 50
  132. // "femten", "manden" - only a short "n" sound
  133. IF nextPhW(n) THEN
  134. length 15
  135. ENDIF
  136. IF prevPhW(isNotVowel) AND thisPh(isWordEnd) THEN
  137. length 15
  138. ENDIF
  139. // "lige" [li@-]
  140. IF prevPhW(i) AND thisPh(isWordEnd) THEN
  141. length 15
  142. ENDIF
  143. FMT(vowel/@-)
  144. endphoneme
  145. // ToDo: change [@] to [a#] if adjacent to [r] or [R]
  146. phoneme 3
  147. vowel starttype #a endtype #a
  148. unstressed
  149. length 40
  150. FMT(vowel/a#_3)
  151. endphoneme
  152. // PB sort of schwa [ɐ] (0250+032F)
  153. // "spurgt" [sp'o3-d] – ipa [spˈoɐ̯d]
  154. phoneme 3- // used for 'r' after a vowel (to create a diphthong)
  155. liquid
  156. lengthmod 7
  157. ipa ɐ̯
  158. FMT(r/a_)
  159. endphoneme
  160. phoneme i
  161. vowel starttype #i endtype #i
  162. length 140
  163. // Long vowel followed by consonant and @- "gide", "pile"
  164. IF nextPhW(isNotVowel) AND next2PhW(@-) THEN
  165. // length 225
  166. ENDIF
  167. // "gider", vrider"
  168. IF nextPhW(D) AND next2PhW(V) OR next2PhW(?V) THEN
  169. length 140
  170. ENDIF
  171. //"skider" short
  172. IF nextPhW(D) AND next2PhW(V) THEN
  173. length 140
  174. ENDIF
  175. //"skideren" long
  176. IF nextPhW(D) AND next2PhW(V) AND next3PhW(V) THEN
  177. length 225
  178. ENDIF
  179. CALL LongVowelLength
  180. FMT(vowel/i_4)
  181. endphoneme
  182. // PB short i
  183. // sviret vs. svirret
  184. phoneme ?i
  185. vowel starttype #i endtype #i
  186. length 140
  187. CALL ShortVowelLength
  188. IfNextVowelAppend(;)
  189. FMT(vowel/i_4)
  190. endphoneme
  191. // PB English i - Tim
  192. phoneme I
  193. vowel starttype #i endtype #i
  194. length 130
  195. IfNextVowelAppend(;)
  196. FMT(vowel/ii_2)
  197. endphoneme
  198. phoneme e
  199. vowel starttype #e endtype #e
  200. length 140
  201. CALL LongVowelLength
  202. CALL ShortVowelLength
  203. FMT(vowel/e)
  204. endphoneme
  205. // PB short e
  206. // "skille" vs. "skele", "pille" vs. "pile"
  207. phoneme ?e
  208. vowel starttype #e endtype #e
  209. length 140
  210. CALL ShortVowelLength
  211. FMT(vowel/e)
  212. endphoneme
  213. phoneme E
  214. vowel starttype #e endtype #e
  215. length 140
  216. // no link with next vowel
  217. IF thisPh(isWordEnd) THEN
  218. IfNextVowelAppend(_!)
  219. ENDIF
  220. // "ære", "kærester", "ærefrygt" - vowel + vowel
  221. IF nextPhW(V) THEN
  222. length 225
  223. ENDIF
  224. // "dræber" TEST shortened by -70 in procedure because of the "r" sound
  225. IF prevPhW(R) OR prevPhW(r) OR prevPhW(3-) AND next2PhW(V) THEN
  226. length 225
  227. ENDIF
  228. CALL LongVowelLength
  229. // "værelse" [v'E3-Vls@_!]
  230. IF nextPhW(3-) AND next2PhW(V) THEN
  231. length 100
  232. ENDIF
  233. FMT(vowel/e_mid2)
  234. endphoneme
  235. // PB short E
  236. // "læsse" vs. "læse"
  237. phoneme ?E
  238. vowel starttype #e endtype #e
  239. ipa ε
  240. length 140
  241. CALL ShortVowelLength
  242. FMT(vowel/e_mid2)
  243. endphoneme
  244. phoneme &
  245. vowel starttype #e endtype #e
  246. ipa æ
  247. length 140
  248. // "same", "sale", "bade" - consonant + @-: long
  249. // but NOT "hinanden"
  250. IF nextPhW(isNotVowel) AND next2PhW(@-) OR next2PhW(@) THEN
  251. IF NOT next3PhW(n) THEN
  252. length 225
  253. ENDIF
  254. ENDIF
  255. // ThisPh + V or @-
  256. // "ae", "aer" vowel + vowel: extra length
  257. IF nextPhW(@-) OR nextPhW(V) THEN
  258. length 260
  259. ENDIF
  260. CALL LongVowelLength
  261. FMT(vowel/ee_2)
  262. endphoneme
  263. // Short &
  264. // e.g. the last a in "staldkarl"
  265. // "sale" vs. "sal"
  266. phoneme ?&
  267. vowel starttype #e endtype #e
  268. length 140
  269. FMT(vowel/ee_2)
  270. endphoneme
  271. // Added for the æ in "dræbt"
  272. phoneme &#
  273. vowel starttype #e endtype #e
  274. length 140
  275. ipa a
  276. CALL LongVowelLength
  277. // CALL ShortVowelLength
  278. FMT(vowel/&)
  279. endphoneme
  280. // PB short &#
  281. // "revl" vs. "tremme"
  282. phoneme ?&#
  283. vowel starttype #e endtype #e
  284. length 140
  285. CALL ShortVowelLength
  286. FMT(vowel/&)
  287. endphoneme
  288. phoneme A // PB changed to a_8
  289. vowel starttype #a endtype #a
  290. length 140
  291. CALL LongVowelLength
  292. // "fare" [f'A:A]
  293. IF nextPhW(A) THEN
  294. length 225
  295. ENDIF
  296. FMT(vowel/a_8)
  297. endphoneme
  298. // PB short A
  299. // "krabbe" vs. "drabelig"
  300. phoneme ?A
  301. vowel starttype #a endtype #a
  302. length 140
  303. CALL ShortVowelLength
  304. FMT(vowel/a_8)
  305. endphoneme
  306. phoneme u
  307. vowel starttype #u endtype #u
  308. length 140
  309. // "suge", "uge", "bluse", "julegave"
  310. IF nextPhW(@-) OR nextPhW(V) OR next2PhW(@-) OR next2PhW(V)THEN
  311. length 225
  312. ENDIF
  313. CALL LongVowelLength
  314. FMT(vowel/u_bck)
  315. endphoneme
  316. // Short u
  317. // "tude" vs. "tuden" - [tuD3] [t?uD@n]
  318. phoneme ?u
  319. vowel starttype #u endtype #u
  320. length 140
  321. CALL ShortVowelLength
  322. FMT(vowel/u_bck)
  323. endphoneme
  324. phoneme o
  325. vowel starttype #o endtype #o
  326. length 140
  327. // "bore", "borer" [boV] o + V
  328. IF nextPhW(V) OR nextPhW(@-) THEN
  329. length 225
  330. ENDIF
  331. // "kone", "koner" o + consonant + V or @-
  332. IF next2PhW(V) OR next2PhW(@-) THEN
  333. length 225
  334. ENDIF
  335. CALL LongVowelLength
  336. FMT(vowel/o_2)
  337. endphoneme
  338. // PB Short o
  339. // "patron" vs. "kone"
  340. phoneme ?o
  341. vowel starttype #o endtype #o
  342. length 140
  343. FMT(vowel/o_2)
  344. endphoneme
  345. phoneme O
  346. vowel starttype #o endtype #o
  347. length 140
  348. ipa ɒ // changed from ɔ - Den Danske Ordbog: ɒ
  349. // "sove", "sover" - consonant + @ or V: long
  350. IF next2PhW(@-) OR next2PhW(V) THEN
  351. length 225
  352. ENDIF
  353. // PB "gået" - ThisPh + V or @-
  354. IF nextPhW(V) OR nextPhW(@-) THEN
  355. length 225
  356. ENDIF
  357. // "såre", "sårede" [s'O:?OD@-]
  358. IF nextPhW(O) OR nextPhW(?O) THEN
  359. length 225
  360. ENDIF
  361. CALL LongVowelLength
  362. FMT(vowel/o_5)
  363. endphoneme
  364. // Short O
  365. // "toget" vs. "tåget"
  366. phoneme ?O
  367. vowel starttype #o endtype #o
  368. length 140
  369. FMT(vowel/o_5)
  370. endphoneme
  371. phoneme V
  372. vowel starttype #@ endtype #@
  373. length 140
  374. CALL LongVowelLength
  375. FMT(vowel/V_4)
  376. endphoneme
  377. // PB Short V
  378. // "forstår" vs. "kåre"
  379. phoneme ?V
  380. vowel starttype #@ endtype #@
  381. length 140
  382. FMT(vowel/V_4)
  383. endphoneme
  384. phoneme 0
  385. vowel starttype #o endtype #o
  386. length 140
  387. ipa ɔ
  388. FMT(vowel/oo_2)
  389. endphoneme
  390. // Short 0 "sukker"
  391. phoneme ?0
  392. vowel starttype #o endtype #o
  393. length 140
  394. ipa ɔ
  395. FMT(vowel/oo_2)
  396. endphoneme
  397. phoneme y
  398. vowel starttype #i endtype #i
  399. length 140
  400. // PB long vowel followed by consonant and certain vowels
  401. // "gyde", "gyder"
  402. IF nextPhW(isNotVowel) AND next2PhW(@-) OR next2PhW(V) THEN
  403. // not "gebyret" TEST
  404. IF NOT nextPhW(3-) AND NOT nextPhW(R) AND NOT nextPhW(r) THEN
  405. length 225
  406. ENDIF
  407. ENDIF
  408. // "syge" [sy@-] vowel + vowel: extra length, but NOT "fyret" [fyVD]
  409. IF nextPhW(@-) OR nextPhW(3) AND NOT next2PhW(D) THEN
  410. length 225
  411. ENDIF
  412. // "tyve"
  413. IF nextPhW(w) AND next2PhW(@-) THEN
  414. length 225
  415. ENDIF
  416. CALL LongVowelLength
  417. FMT(vowel/y)
  418. endphoneme
  419. // PB Short y
  420. // "kylling" vs. "kyle", "krybbe" vs. "krybe"
  421. phoneme ?y
  422. vowel starttype #i endtype #i
  423. length 140
  424. CALL ShortVowelLength
  425. FMT(vowel/y)
  426. endphoneme
  427. phoneme Y
  428. vowel starttype #i endtype #i
  429. length 140
  430. IF nextPhW(V) OR nextPhW(@-) THEN
  431. length 225
  432. ENDIF
  433. FMT(vowel/yy)
  434. endphoneme
  435. phoneme W
  436. vowel starttype #@ endtype #@
  437. length 140
  438. // "røveri" but NOT "surfer" [sWfV] TEST
  439. IF next2PhW(V) OR next2PhW(?V) AND NOT next2PhW(isFinalVowel) THEN
  440. length 140
  441. ENDIF
  442. // "børnebog" - short
  443. IF nextPhW(r) AND next2PhW(n) AND next3PhW(@-) THEN
  444. length 140
  445. ENDIF
  446. CALL LongVowelLength
  447. FMT(vowel/oe)
  448. endphoneme
  449. // Short W
  450. // "prøv" vs. "prøve"
  451. phoneme ?W
  452. vowel starttype #@ endtype #@
  453. length 140
  454. CALL ShortVowelLength
  455. FMT(vowel/oe)
  456. endphoneme
  457. // Added for the ø in "røv", "røg", "øje" instead of [V3]
  458. phoneme W#
  459. vowel starttype #@ endtype #@
  460. length 140 //225
  461. // PB long vowel followed by consonant and certain vowels
  462. IF nextPhW(isNotVowel) AND next2PhW(@-) OR next2PhW(@) OR next2PhW(3) OR next2PhW(V) OR next2PhW(?V) THEN
  463. length 225
  464. ENDIF
  465. FMT(vowel/V)
  466. endphoneme
  467. // Short W#
  468. // "rømme"
  469. phoneme ?W#
  470. vowel starttype #@ endtype #@
  471. length 140
  472. CALL ShortVowelLength
  473. FMT(vowel/V)
  474. endphoneme
  475. phoneme aI
  476. vowel starttype #a endtype #i
  477. length 300
  478. IF NOT next2Ph(3) AND NOT next2Ph(V) AND NOT next2Ph(@-) AND nextPhW(isNotVowel) THEN
  479. glstop
  480. length 225
  481. ENDIF
  482. // "dreje" [dR'aI@-_!]
  483. IF nextPhW(3) OR nextPhW(V) OR nextPhW(@) OR nextPhW(@-) THEN
  484. length 280
  485. ENDIF
  486. // PB "drej" vs. "dreje"
  487. IF thisPh(isWordEnd) THEN
  488. length 140
  489. ENDIF
  490. // "lejde" [l'aId@-_!], "lejder" [l'aIdV_!]
  491. IF nextPhW(isNotVowel) AND next2PhW(@-) OR next2PhW(V) THEN
  492. length 190
  493. ENDIF
  494. FMT(vdiph/ai)
  495. endphoneme
  496. // CONSONANTS
  497. // PB added l/3
  498. phoneme l
  499. liquid
  500. lengthmod 7
  501. // [ll] => [-l] - avoid double l
  502. IF nextPhW(l) THEN
  503. // ChangePhoneme(-)
  504. ENDIF
  505. ChangePhoneme(l/3)
  506. // CALL base/l
  507. endphoneme
  508. phoneme l/3 // Replacement for [l/]
  509. liquid
  510. lengthmod 7
  511. FMT(l/l_)
  512. endphoneme
  513. phoneme v // approximant, not fricative
  514. import_phoneme base/v#
  515. voicingswitch f
  516. endphoneme
  517. // PB Actually a kind of schwa = [ɐ]? - "byder" [bˈyðɐʌ]
  518. phoneme r // used for 'r' after a vowel (to create a diphthong)
  519. liquid
  520. lengthmod 7
  521. ipa ɐ̯
  522. IF nextPhW(isVowel) AND NOT nextPhW(?V) AND NOT nextPhW(V) AND NOT nextPhW(@-) THEN
  523. ChangePhoneme(R)
  524. ENDIF
  525. FMT(r/a_)
  526. endphoneme
  527. phoneme R
  528. lengthmod 6
  529. liquid
  530. ipa ʁ
  531. FMT(r/aa)
  532. endphoneme
  533. // don't weaken consonants at end of word or before a stop
  534. phoneme s
  535. vls alv frc sibilant
  536. voicingswitch z
  537. lengthmod 3
  538. Vowelin f1=0 f2=1700 -300 300 f3=-100 80
  539. Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20
  540. IF nextPh(p) OR nextPh(t) OR nextPh(k) THEN
  541. WAV(ufric/s!)
  542. ENDIF
  543. WAV(ufric/s)
  544. endphoneme
  545. phoneme p
  546. vls blb stop
  547. voicingswitch b
  548. lengthmod 7
  549. Vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11
  550. Vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=22
  551. IF nextPh(isPause2) THEN
  552. WAV(ustop/p_unasp)
  553. ELIF nextPh(r) THEN
  554. WAV(ustop/pr, 70)
  555. ELIF nextPh(R) OR nextPh(R2) THEN
  556. WAV(ustop/pr)
  557. ELIF nextPh(@-) THEN
  558. WAV(ustop/p_unasp)
  559. ELIF nextPh(l) THEN
  560. WAV(ustop/pl)
  561. ENDIF
  562. WAV(ustop/p)
  563. endphoneme
  564. phoneme t
  565. vls alv stop
  566. voicingswitch d
  567. lengthmod 7
  568. Vowelin f1=0 f2=1700 -300 300 f3=-100 80
  569. Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20
  570. IF nextPh(r) OR nextPh(R) OR nextPh(R2) THEN
  571. WAV(ustop/tr)
  572. ENDIF
  573. // "respekt" [REsp'Egd]
  574. IF thisPh(isWordEnd) THEN
  575. // ChangePhoneme(d)
  576. ENDIF
  577. WAV(ustop/t, 90)
  578. endphoneme
  579. phoneme j
  580. liquid palatal
  581. lengthmod 7
  582. // no link with next vowel
  583. IF thisPh(isWordEnd) THEN
  584. IfNextVowelAppend(_!)
  585. ENDIF
  586. IF nextPhW(isVowel) THEN
  587. NextVowelStarts
  588. VowelStart(j/j@)
  589. VowelStart(j/ja)
  590. VowelStart(j/je,-35)
  591. VowelStart(j/ji)
  592. VowelStart(j/jo,-65) // "kjole"
  593. VowelStart(j/ju)
  594. EndSwitch
  595. Vowelout len=70
  596. VowelEnding(j/xj, -30)
  597. IF prevPh(isPause) THEN
  598. FMT(j/_j)
  599. ENDIF
  600. ELSE
  601. // no vowel follows
  602. Vowelout len=70
  603. FMT(j/j_)
  604. ENDIF
  605. endphoneme