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.

phonemelist.c 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /*
  2. * Copyright (C) 2005 to 2014 by Jonathan Duddington
  3. * email: [email protected]
  4. * Copyright (C) 2015-2016 Reece H. Dunn
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  18. */
  19. #include "config.h"
  20. #include <stdbool.h>
  21. #include <stdint.h>
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. #include <espeak-ng/espeak_ng.h>
  26. #include <espeak-ng/speak_lib.h>
  27. #include <espeak-ng/encoding.h>
  28. #include "phonemelist.h"
  29. #include "phoneme.h" // for PHONEME_TAB, phVOWEL, REPLACE_PHONEMES, phPAUSE
  30. #include "synthdata.h" // for InterpretPhoneme, SelectPhonemeTable
  31. #include "synthesize.h" // for PHONEME_LIST, PHONEME_LIST2, phoneme_tab
  32. #include "translate.h" // for Translator, LANGUAGE_OPTIONS, option_wordgap
  33. #include "phoneme.h"
  34. #include "synthesize.h"
  35. #include "translate.h"
  36. #include "speech.h"
  37. const unsigned char pause_phonemes[8] = {
  38. 0, phonPAUSE_VSHORT, phonPAUSE_SHORT, phonPAUSE, phonPAUSE_LONG, phonGLOTTALSTOP, phonPAUSE_LONG, phonPAUSE_LONG
  39. };
  40. extern int n_ph_list2;
  41. extern PHONEME_LIST2 ph_list2[N_PHONEME_LIST]; // first stage of text->phonemes
  42. static int SubstitutePhonemes(PHONEME_LIST *plist_out)
  43. {
  44. // Copy the phonemes list and perform any substitutions that are required for the
  45. // current voice
  46. int ix;
  47. int k;
  48. int replace_flags;
  49. int n_plist_out = 0;
  50. bool word_end;
  51. PHONEME_LIST2 *plist2;
  52. PHONEME_TAB *next = NULL;
  53. int deleted_sourceix = -1;
  54. for (ix = 0; (ix < n_ph_list2) && (n_plist_out < N_PHONEME_LIST); ix++) {
  55. plist2 = &ph_list2[ix];
  56. if (deleted_sourceix != -1) {
  57. plist2->sourceix = deleted_sourceix;
  58. deleted_sourceix = -1;
  59. }
  60. if (plist2->phcode == phonSWITCH)
  61. SelectPhonemeTable(plist2->tone_ph);
  62. // don't do any substitution if the language has been temporarily changed
  63. if (!(plist2->synthflags & SFLAG_SWITCHED_LANG)) {
  64. if (ix < (n_ph_list2 -1))
  65. next = phoneme_tab[ph_list2[ix+1].phcode];
  66. word_end = false;
  67. if (ix == n_ph_list2 -1 || (plist2+1)->sourceix || ((next != 0) && (next->type == phPAUSE)))
  68. word_end = true; // this phoneme is the end of a word
  69. // check whether a Voice has specified that we should replace this phoneme
  70. for (k = 0; k < n_replace_phonemes; k++) {
  71. if (plist2->phcode == replace_phonemes[k].old_ph) {
  72. replace_flags = replace_phonemes[k].type;
  73. if ((replace_flags & 1) && (word_end == false))
  74. continue; // this replacement only occurs at the end of a word
  75. if ((replace_flags & 2) && ((plist2->stresslevel & 0x7) > 3))
  76. continue; // this replacement doesn't occur in stressed syllables
  77. if ((replace_flags & 4) && (plist2->sourceix == 0))
  78. continue; // this replacement only occurs at the start of a word
  79. // substitute the replacement phoneme
  80. plist2->phcode = replace_phonemes[k].new_ph;
  81. if ((plist2->stresslevel > 1) && (phoneme_tab[plist2->phcode]->phflags & phUNSTRESSED))
  82. plist2->stresslevel = 0; // the replacement must be unstressed
  83. break;
  84. }
  85. }
  86. if (plist2->phcode == 0) {
  87. deleted_sourceix = plist2->sourceix;
  88. continue; // phoneme has been replaced by NULL, so don't copy it
  89. }
  90. }
  91. // copy phoneme into the output list
  92. memcpy(&plist_out[n_plist_out], plist2, sizeof(PHONEME_LIST2));
  93. plist_out[n_plist_out].ph = phoneme_tab[plist2->phcode];
  94. plist_out[n_plist_out].type = plist_out[n_plist_out].ph->type;
  95. n_plist_out++;
  96. }
  97. return n_plist_out;
  98. }
  99. void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence)
  100. {
  101. int ix = 0;
  102. int j;
  103. int insert_ph = 0;
  104. PHONEME_LIST *phlist;
  105. PHONEME_TAB *ph;
  106. PHONEME_TAB *next, *next2;
  107. int unstress_count = 0;
  108. int word_stress = 0;
  109. int current_phoneme_tab;
  110. int max_stress;
  111. int voicing;
  112. int regression;
  113. int end_sourceix;
  114. int alternative;
  115. int delete_count;
  116. int word_start;
  117. bool inserted;
  118. bool deleted;
  119. PHONEME_DATA phdata;
  120. bool start_of_clause = true;
  121. int n_ph_list3;
  122. PHONEME_LIST *plist3;
  123. PHONEME_LIST *plist3_inserted = NULL;
  124. PHONEME_LIST ph_list3[N_PHONEME_LIST];
  125. PHONEME_LIST2 *plist2;
  126. WORD_PH_DATA worddata;
  127. memset(&worddata, 0, sizeof(worddata));
  128. plist2 = ph_list2;
  129. phlist = phoneme_list;
  130. end_sourceix = plist2[n_ph_list2-1].sourceix;
  131. MAKE_MEM_UNDEFINED(&phoneme_list, sizeof(phoneme_list));
  132. // is the last word of the clause unstressed ?
  133. max_stress = 0;
  134. for (j = n_ph_list2-3; j >= 0; j--) {
  135. // start with the last phoneme (before the terminating pauses) and move backwards
  136. if ((plist2[j].stresslevel & 0x7f) > max_stress)
  137. max_stress = plist2[j].stresslevel & 0x7f;
  138. if (plist2[j].sourceix != 0)
  139. break;
  140. }
  141. if (max_stress < 4) {
  142. // the last word is unstressed, look for a previous word that can be stressed
  143. while (--j >= 0) {
  144. if (plist2[j].synthflags & SFLAG_PROMOTE_STRESS) { // dictionary flags indicated that this stress can be promoted
  145. plist2[j].stresslevel = 4; // promote to stressed
  146. break;
  147. }
  148. if (plist2[j].stresslevel >= 4) {
  149. // found a stressed syllable, so stop looking
  150. break;
  151. }
  152. }
  153. }
  154. // look for switch of phoneme tables
  155. delete_count = 0;
  156. current_phoneme_tab = tr->phoneme_tab_ix;
  157. int deleted_sourceix = -1;
  158. for (j = 0; j < n_ph_list2; j++) {
  159. if (current_phoneme_tab != tr->phoneme_tab_ix)
  160. plist2[j].synthflags |= SFLAG_SWITCHED_LANG;
  161. if (delete_count > 0) {
  162. memcpy(&plist2[j-delete_count], &plist2[j], sizeof(plist2[0]));
  163. if (deleted_sourceix != -1) {
  164. plist2[j-delete_count].sourceix = deleted_sourceix;
  165. deleted_sourceix = -1;
  166. }
  167. }
  168. if (plist2[j].phcode == phonSWITCH) {
  169. if ((!(plist2[j].synthflags & SFLAG_EMBEDDED)) && (
  170. (plist2[j].tone_ph == current_phoneme_tab) ||
  171. (plist2[j+1].phcode == phonSWITCH) ||
  172. ((plist2[j+1].phcode == phonPAUSE) && (plist2[j+2].phcode == phonSWITCH))
  173. )) {
  174. // delete this phonSWITCH if it's switching to the current phoneme table, or
  175. // delete this phonSWITCH if its followed by another phonSWITCH
  176. if (deleted_sourceix == -1 && plist2[j].sourceix != 0)
  177. deleted_sourceix = plist2[j].sourceix;
  178. delete_count++;
  179. } else
  180. current_phoneme_tab = plist2[j].tone_ph;
  181. }
  182. }
  183. n_ph_list2 -= delete_count;
  184. SelectPhonemeTable(current_phoneme_tab);
  185. if ((regression = tr->langopts.param[LOPT_REGRESSIVE_VOICING]) != 0) {
  186. // set consonant clusters to all voiced or all unvoiced
  187. // Regressive
  188. int type;
  189. bool stop_propagation = false;
  190. voicing = 0;
  191. for (j = n_ph_list2-1; j >= 0; j--) {
  192. if (plist2[j].phcode == phonSWITCH) {
  193. /* Find previous phonSWITCH to determine language we're switching back to */
  194. int k;
  195. for (k = j-1; k >= 0; k--)
  196. if (plist2[k].phcode == phonSWITCH)
  197. break;
  198. if (k >= 0)
  199. SelectPhonemeTable(plist2[k].tone_ph);
  200. else
  201. SelectPhonemeTable(tr->phoneme_tab_ix);
  202. }
  203. ph = phoneme_tab[plist2[j].phcode];
  204. if (ph == NULL)
  205. continue;
  206. if (plist2[j].synthflags & SFLAG_SWITCHED_LANG) {
  207. stop_propagation = false;
  208. voicing = 0;
  209. if (regression & 0x100)
  210. voicing = 1; // word-end devoicing
  211. continue;
  212. }
  213. type = ph->type;
  214. if (regression & 0x2) {
  215. // [v] amd [v;] don't cause regression, or [R^]
  216. if (((ph->mnemonic & 0xff) == 'v') || ((ph->mnemonic & 0xff) == 'R')) {
  217. stop_propagation = true;
  218. if (regression & 0x10)
  219. voicing = 0;
  220. }
  221. }
  222. if ((type == phSTOP) || type == (phFRICATIVE)) {
  223. if ((voicing == 0) && (regression & 0xf))
  224. voicing = 1;
  225. else if ((voicing == 2) && (ph->end_type != 0)) // use end_type field for voicing_switch for consonants
  226. plist2[j].phcode = ph->end_type; // change to voiced equivalent
  227. } else if ((type == phVSTOP) || type == (phVFRICATIVE)) {
  228. if ((voicing == 0) && (regression & 0xf))
  229. voicing = 2;
  230. else if ((voicing == 1) && (ph->end_type != 0))
  231. plist2[j].phcode = ph->end_type; // change to unvoiced equivalent
  232. } else {
  233. if (regression & 0x8) {
  234. // LANG=Polish, propagate through liquids and nasals
  235. if ((type == phPAUSE) || (type == phVOWEL))
  236. voicing = 0;
  237. } else
  238. voicing = 0;
  239. }
  240. if (stop_propagation) {
  241. voicing = 0;
  242. stop_propagation = false;
  243. }
  244. if (plist2[j].sourceix) {
  245. if (regression & 0x04) {
  246. // stop propagation at a word boundary
  247. voicing = 0;
  248. }
  249. if (regression & 0x100) {
  250. // devoice word-final consonants, unless propagating voiced
  251. if (voicing == 0)
  252. voicing = 1;
  253. }
  254. }
  255. }
  256. }
  257. SelectPhonemeTable(tr->phoneme_tab_ix);
  258. n_ph_list3 = SubstitutePhonemes(ph_list3) - 2;
  259. for (j = 0; (j < n_ph_list3) && (ix < N_PHONEME_LIST-3);) {
  260. if (ph_list3[j].sourceix) {
  261. // start of a word
  262. int k;
  263. int nextw;
  264. word_stress = 0;
  265. // find the highest stress level in this word
  266. for (nextw = j; nextw < n_ph_list3;) {
  267. if (ph_list3[nextw].stresslevel > word_stress)
  268. word_stress = ph_list3[nextw].stresslevel;
  269. nextw++;
  270. if (ph_list3[nextw].sourceix)
  271. break; // start of the next word
  272. }
  273. for (k = j; k < nextw; k++)
  274. ph_list3[k].wordstress = word_stress;
  275. j = nextw;
  276. } else
  277. j++;
  278. }
  279. // transfer all the phonemes of the clause into phoneme_list
  280. ph = phoneme_tab[phonPAUSE];
  281. ph_list3[0].ph = ph;
  282. word_start = 1;
  283. SelectPhonemeTable(tr->phoneme_tab_ix);
  284. for (j = 0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++) {
  285. plist3 = &ph_list3[j];
  286. inserted = false;
  287. deleted = false;
  288. if (insert_ph != 0) {
  289. // we have a (linking) phoneme which we need to insert here
  290. next = phoneme_tab[plist3->phcode]; // this phoneme, i.e. after the insert
  291. // re-use the previous entry for the inserted phoneme.
  292. // That's OK because we don't look backwards from plist3 *** but CountVowelPosition() and isAfterStress does !!!
  293. j--;
  294. plist3 = plist3_inserted = &ph_list3[j];
  295. if (j > 0) {
  296. // move all previous phonemes in the word back one place
  297. int k;
  298. if (word_start > 0) {
  299. k = word_start;
  300. word_start--;
  301. } else
  302. k = 2; // No more space, don't loose the start of word mark at ph_list2[word_start]
  303. for (; k <= j; k++)
  304. memcpy(&ph_list3[k-1], &ph_list3[k], sizeof(*plist3));
  305. }
  306. memset(&plist3[0], 0, sizeof(*plist3));
  307. plist3->phcode = insert_ph;
  308. ph = phoneme_tab[insert_ph];
  309. plist3->ph = ph;
  310. insert_ph = 0;
  311. inserted = true; // don't insert the same phoneme repeatedly
  312. } else {
  313. // otherwise get the next phoneme from the list
  314. if (plist3->sourceix != 0)
  315. word_start = j;
  316. ph = phoneme_tab[plist3->phcode];
  317. plist3[0].ph = ph;
  318. if (plist3->phcode == phonSWITCH) {
  319. // change phoneme table
  320. SelectPhonemeTable(plist3->tone_ph);
  321. }
  322. next = phoneme_tab[plist3[1].phcode]; // the phoneme after this one
  323. plist3[1].ph = next;
  324. }
  325. if (ph == NULL) continue;
  326. InterpretPhoneme(tr, 0x100, plist3, &phdata, &worddata);
  327. if ((alternative = phdata.pd_param[pd_CHANGE_NEXTPHONEME]) > 0) {
  328. ph_list3[j+1].ph = phoneme_tab[alternative];
  329. ph_list3[j+1].phcode = alternative;
  330. ph_list3[j+1].type = phoneme_tab[alternative]->type;
  331. next = phoneme_tab[alternative];
  332. }
  333. if (((alternative = phdata.pd_param[pd_INSERTPHONEME]) > 0) && (inserted == false)) {
  334. // PROBLEM: if we insert a phoneme before a vowel then we loose the stress.
  335. PHONEME_TAB *ph2;
  336. ph2 = ph;
  337. insert_ph = plist3->phcode;
  338. ph = phoneme_tab[alternative];
  339. plist3->ph = ph;
  340. plist3->phcode = alternative;
  341. if (ph->type == phVOWEL) {
  342. plist3->synthflags |= SFLAG_SYLLABLE;
  343. if (ph2->type != phVOWEL)
  344. plist3->stresslevel = 0; // change from non-vowel to vowel, make sure it's unstressed
  345. } else
  346. plist3->synthflags &= ~SFLAG_SYLLABLE;
  347. // re-interpret the changed phoneme
  348. // But it doesn't obey a second ChangePhoneme()
  349. InterpretPhoneme(tr, 0x100, plist3, &phdata, &worddata);
  350. }
  351. if ((alternative = phdata.pd_param[pd_CHANGEPHONEME]) > 0) {
  352. PHONEME_TAB *ph2;
  353. ph2 = ph;
  354. ph = phoneme_tab[alternative];
  355. plist3->ph = ph;
  356. plist3->phcode = alternative;
  357. if (alternative == 1)
  358. deleted = true; // NULL phoneme, discard
  359. else {
  360. if (ph->type == phVOWEL) {
  361. plist3->synthflags |= SFLAG_SYLLABLE;
  362. if (ph2->type != phVOWEL)
  363. plist3->stresslevel = 0; // change from non-vowel to vowel, make sure it's unstressed
  364. } else
  365. plist3->synthflags &= ~SFLAG_SYLLABLE;
  366. // re-interpret the changed phoneme
  367. // But it doesn't obey a second ChangePhoneme()
  368. InterpretPhoneme(tr, 0x100, plist3, &phdata, &worddata);
  369. }
  370. }
  371. if ((ph->type == phVOWEL) && (deleted == false)) {
  372. PHONEME_LIST *p;
  373. // Check for consecutive unstressed syllables, even across word boundaries.
  374. // Do this after changing phonemes according to stress level.
  375. if (plist3->stresslevel <= 1) {
  376. // an unstressed vowel
  377. unstress_count++;
  378. if (tr->langopts.stress_flags & 0x08) {
  379. // change sequences of consecutive unstressed vowels in unstressed words to diminished stress (TEST)
  380. for (p = plist3+1; p->type != phPAUSE; p++) {
  381. if (p->type == phVOWEL) {
  382. if (p->stresslevel <= 1) {
  383. if (plist3->wordstress < 4)
  384. plist3->stresslevel = 0;
  385. if (p->wordstress < 4)
  386. p->stresslevel = 0;
  387. }
  388. break;
  389. }
  390. }
  391. } else {
  392. if ((unstress_count > 1) && ((unstress_count & 1) == 0)) {
  393. // in a sequence of unstressed syllables, reduce alternate syllables to 'diminished'
  394. // stress. But not for the last phoneme of a stressed word
  395. if ((tr->langopts.stress_flags & S_NO_DIM) || ((word_stress > 3) && ((plist3+1)->sourceix != 0))) {
  396. // An unstressed final vowel of a stressed word
  397. unstress_count = 1; // try again for next syllable
  398. } else
  399. plist3->stresslevel = 0; // change stress to 'diminished'
  400. }
  401. }
  402. } else
  403. unstress_count = 0;
  404. }
  405. if ((plist3+1)->synthflags & SFLAG_LENGTHEN) {
  406. static const char types_double[] = { phFRICATIVE, phVFRICATIVE, phNASAL, phLIQUID, 0 };
  407. if ((j > 0) && (strchr(types_double, next->type))) {
  408. // lengthen this consonant by doubling it
  409. // BUT, can't insert a phoneme at position plist3[0] because it crashes PrevPh()
  410. insert_ph = next->code;
  411. (plist3+1)->synthflags ^= SFLAG_LENGTHEN;
  412. }
  413. }
  414. if ((plist3+1)->sourceix != 0) {
  415. int x;
  416. if (tr->langopts.vowel_pause && (ph->type != phPAUSE)) {
  417. if ((ph->type != phVOWEL) && (tr->langopts.vowel_pause & 0x200)) {
  418. // add a pause after a word which ends in a consonant
  419. insert_ph = phonPAUSE_NOLINK;
  420. }
  421. if (next->type == phVOWEL) {
  422. if ((x = tr->langopts.vowel_pause & 0x0c) != 0) {
  423. // break before a word which starts with a vowel
  424. if (x == 0xc)
  425. insert_ph = phonPAUSE_NOLINK;
  426. else
  427. insert_ph = phonPAUSE_VSHORT;
  428. }
  429. if ((ph->type == phVOWEL) && ((x = tr->langopts.vowel_pause & 0x03) != 0)) {
  430. // adjacent vowels over a word boundary
  431. if (x == 2)
  432. insert_ph = phonPAUSE_SHORT;
  433. else
  434. insert_ph = phonPAUSE_VSHORT;
  435. }
  436. if (((plist3+1)->stresslevel >= 4) && (tr->langopts.vowel_pause & 0x100)) {
  437. // pause before a words which starts with a stressed vowel
  438. insert_ph = phonPAUSE_SHORT;
  439. }
  440. }
  441. }
  442. if ((plist3 != plist3_inserted) && (ix > 0)) {
  443. if ((x = (tr->langopts.word_gap & 0x7)) != 0) {
  444. if ((x > 1) || ((insert_ph != phonPAUSE_SHORT) && (insert_ph != phonPAUSE_NOLINK))) {
  445. // don't reduce the pause
  446. insert_ph = pause_phonemes[x];
  447. }
  448. }
  449. if (option_wordgap > 0)
  450. insert_ph = phonPAUSE_LONG;
  451. }
  452. }
  453. next2 = phoneme_tab[plist3[2].phcode];
  454. plist3[2].ph = next2;
  455. if ((insert_ph == 0) && (phdata.pd_param[pd_APPENDPHONEME] != 0))
  456. insert_ph = phdata.pd_param[pd_APPENDPHONEME];
  457. if (deleted == false) {
  458. phlist[ix].ph = ph;
  459. phlist[ix].type = ph->type;
  460. phlist[ix].env = PITCHfall; // default, can be changed in the "intonation" module
  461. phlist[ix].synthflags = plist3->synthflags;
  462. phlist[ix].stresslevel = plist3->stresslevel & 0xf;
  463. phlist[ix].wordstress = plist3->wordstress;
  464. phlist[ix].tone_ph = plist3->tone_ph;
  465. phlist[ix].sourceix = 0;
  466. phlist[ix].phcode = ph->code;
  467. if (plist3->sourceix != 0) {
  468. phlist[ix].sourceix = plist3->sourceix;
  469. phlist[ix].newword = PHLIST_START_OF_WORD;
  470. if (start_sentence) {
  471. phlist[ix].newword |= PHLIST_START_OF_SENTENCE;
  472. start_sentence = false;
  473. }
  474. if (start_of_clause) {
  475. phlist[ix].newword |= PHLIST_START_OF_CLAUSE;
  476. start_of_clause = false;
  477. }
  478. } else
  479. phlist[ix].newword = 0;
  480. phlist[ix].length = phdata.pd_param[i_SET_LENGTH]*2;
  481. if ((ph->code == phonPAUSE_LONG) && (option_wordgap > 0) && (plist3[1].sourceix != 0)) {
  482. phlist[ix].ph = phoneme_tab[phonPAUSE_SHORT];
  483. phlist[ix].length = option_wordgap*14; // 10mS per unit at the default speed
  484. }
  485. if (ph->type == phVOWEL || ph->type == phLIQUID || ph->type == phNASAL || ph->type == phVSTOP || ph->type == phVFRICATIVE || (ph->phflags & phPREVOICE)) {
  486. phlist[ix].length = 128; // length_mod
  487. phlist[ix].env = PITCHfall;
  488. }
  489. phlist[ix].prepause = 0;
  490. phlist[ix].amp = 20; // default, will be changed later
  491. phlist[ix].pitch1 = 255;
  492. phlist[ix].pitch2 = 255;
  493. ix++;
  494. }
  495. }
  496. phlist[ix].newword = PHLIST_END_OF_CLAUSE;
  497. phlist[ix].phcode = phonPAUSE;
  498. phlist[ix].type = phPAUSE; // terminate with 2 Pause phonemes
  499. phlist[ix].length = post_pause; // length of the pause, depends on the punctuation
  500. phlist[ix].sourceix = end_sourceix;
  501. phlist[ix].synthflags = 0;
  502. phlist[ix].prepause = 0;
  503. phlist[ix++].ph = phoneme_tab[phonPAUSE];
  504. phlist[ix].newword = 0;
  505. phlist[ix].phcode = phonPAUSE;
  506. phlist[ix].type = phPAUSE;
  507. phlist[ix].length = 0;
  508. phlist[ix].sourceix = 0;
  509. phlist[ix].synthflags = 0;
  510. phlist[ix].prepause = 0;
  511. phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT];
  512. n_phoneme_list = ix;
  513. SelectPhonemeTable(tr->phoneme_tab_ix);
  514. }