Debian Codegraph @

docs/phontab.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3
4 <head>
5 <title>eSpeak: Phoneme tables</title>
6 <meta name="GENERATOR" content="Quanta Plus">
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 </head>
9 <body>
10 <A href="docindex.html">Back</A>
11 <hr>
12 <h2>PHONEME TABLES</h2>
13 <hr>
14 A phoneme table defines all the phonemes which are used by a language, together with their properties and the data for their production as sounds.
15 <p>
16 Generally each language has its own phoneme table, although additional phoneme tables can be used for different voices within the language. These alternatives are referenced from Voice files.
17 <p>
18 A phoneme table does not need to define all the phonemes used by a language. It can inherit the phonemes from a previously defined phoneme table. For example, a phoneme table may redefine (or add) some of the vowels that it uses, but inherit most of its consonants from a standard set.
19 <p>
20 The source files for the phoneme data are in the "phsource" directory in the espeakedit download package. "Vowel files", which are referenced in FMT(), VowelStart(), and VowelEnding() instructions are made using the espeakedit program.
21 </blockquote>
22 <p>&nbsp;<hr>
23 <h3>Phoneme files</h3>
24 The phoneme tables are defined in a master phoneme file, named <strong>phonemes</strong>. This starts with the <strong>base</strong> phoneme table followed by phoneme tables for other languages and voices. These inherit phonemes from the <strong>base</strong> table or previously defined tables.
25 <p>
26 In addition to phoneme definitions, the phoneme file can contain the following:
27 <dl>
28 <dt><strong>include</strong> &lt;filename&gt;
29 <dd>Includes the text of the specified file at this point. This allows different phoneme tables to be kept in different text files, for convenience. &lt;filename&gt; is a relative path. The included file can itself contain <strong>include</strong> statements.
30 <p>
31 <dt><strong>phonemetable</strong> &lt;name&gt; &lt;parent&gt;
32 <dd>Starts a new phoneme table, and ends the previous table.<br>
33 &lt;name&gt; Is the name of this phoneme table. This name is used in Voice files.<br>
34 &lt;parent&gt; Is the name of a previously defined phoneme table whose phoneme definitions are inherited by this one. The name <strong>base</strong> indicates the first (base) phoneme table.
35
36 </dl>
37 <p>&nbsp;<hr>
38 <h3>Phoneme definitions</h3>
39 Note: These new Phoneme definitions apply to eSpeak version 1.42.20 and later.
40 <p>
41 A phoneme table contains a list of phoneme definitions. Each starts with the keyword <strong>phoneme</strong> and the phoneme name (this is the name used in the pronunciation rules in a language's *_rules and *_list files), and ends with the keyword <strong>endphoneme</strong>. For example:
42 <pre> phoneme aI
43 vowel
44 starttype #a endtype #i
45 length 230
46 FMT(vowels/ai)
47 endphoneme
48
49 phoneme s
50 vls alv frc sibilant
51 voicingswitch z
52 lengthmod 3
53 Vowelin f1=0 f2=1700 -300 300 f3=-100 80
54 Vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20
55
56 IF nextPh(isPause) THEN
57 WAV(ufric/s_)
58 ELIF nextPh(p) OR nextPh(t) OR nextPh(k) THEN
59 WAV(ufric/s!)
60 ENDIF
61 WAV(ufric/s)
62 endphoneme
63
64 </pre>
65 <p>
66 A phoneme definition contains both static properties and executed instructions. The instructions may contain conditional statements, so that the effect of the phoneme may be different depending on adjacent phonemes, whether the syllable is stressed, etc.
67 <p>
68 The instructions of a phoneme are interpreted in two different phases. In the first phase, the instructions may change the phoneme and replace it by a different phoneme. In the second phase, instructions are used to produce the sound for the phoneme.
69 <p>
70 The <strong>import_phoneme</strong> statement can be used to copy a previously defined phoneme from a specified phoneme table. For example:
71 <pre>
72 phoneme t
73 import_phoneme base/t[
74 endphoneme
75 </pre>
76 means: <code>phoneme t</code> in this phoneme table is a copy of <code>phoneme t[</code> from phoneme table "base". A <strong>length</strong> instruction can be used after <strong>import_phoneme</strong> to vary the length from the original.
77
78 <p>&nbsp;<hr>
79 <h3>Phoneme Properties</h3>
80
81 Within the phoneme definition the following lines may occur: ( (V) indicates only for vowels, (C) only for consonants)
82 <p>
83 <ul>
84 <dl><dt>Type. One of these must be present.
85 <dd><table>
86 <tr><TD width="100"><b>vowel</b></TD></tr>
87 <tr><TD><b>liquid</b></TD><td>semi-vowels, such as:&nbsp; <code> r, l, j, w</code></td></tr>
88 <tr><TD><b>nasal</b></TD><td>nasal eg:&nbsp; <code> m, n, N</code></td></tr>
89 <tr><TD><b>stop</b></TD><td>stop eg:&nbsp; <code> p, b, t, d, k, g</code></td></tr>
90 <tr><TD><b>frc</b></TD><td>fricative eg:&nbsp; <code> f, v, T, D, s, z, S, Z, C, x</code></td></tr>
91 <tr><TD><b>afr</b></TD><td>affricate eg:&nbsp; <code> tS, dZ</code></td></tr>
92 <tr><TD><b>pause</b></TD><td></td></tr>
93 <tr><TD><b>stress</b></TD><td>used for stress symbols, eg: ' , = %</td></tr>
94 <tr><TD><b>virtual</b></TD><td>Used to represent a class of phonemes.</td></tr>
95 </table>
96 </dl>
97 <dl><dt>Properties:
98 <dd><table>
99 <tr><TD width="100"><b>vls</b></TD><td>(C) voiceless eg. <code> p, t, k, f, s</code></TD></tr>
100 <tr><TD><b>vcd</b></TD><td>(C) voiced eg. <code> b, d, g, v, z</code></td></tr>
101 <tr><TD><b>sibilant</b></TD><td>(C) eg: <code> s, z, S, Z, tS, dZ</code></td></tr>
102 <tr><TD><b>palatal</b></TD><td>(C) A palatal or palatalized consonant.</td></tr>
103 <tr><TD><b>rhotic</b></TD><td>(C) An "r" type consonant.</td></tr>
104 <tr><TD><b>unstressed</b></TD><td>(V) This vowel is always unstressed, unless explicitly marked otherwise.</td></tr>
105 <tr><TD><b>nolink</b></TD><td>Prevent any linking from the previous phoneme.</td></tr>
106 <tr><TD><b>nopause</b></TD><td>Used in a <code>liquid</code> or <code>nasal</code> phoneme to prevent eSpeak inserting a short pause if a word starts with this phoneme and the previous word ends with a vowel.</td></tr>
107 <tr><TD><b>trill</b></TD><td>(C) Apply trill to the voicing.</td></tr>
108 </table>
109 </dl>
110 <dl><dt>Place of Articulation (C):
111 <dd><table>
112 <tr><TD><b>blb &nbsp;</b></TD><td width="100">bi-labial</TD>
113 <TD><b>ldb &nbsp;</b></TD><td width="110">labio-dental</TD>
114 <TD><b>dnt &nbsp;</b></TD><td>dental</TD></tr>
115
116 <tr><TD><b>alv</b></TD><td>alveolar</td>
117 <TD><b>rfx</b></TD><td>retroflex</TD>
118 <TD><b>pla</b></TD><td>palato-alveolar</TD></tr>
119
120 <tr><TD><b>pal</b></TD><td>palatal</td>
121 <TD><b>vel</b></TD><td>velar</TD>
122 <TD><b>lbv</b></TD><td>labio-velar</TD></tr>
123
124 <tr><TD><b>uvl</b></TD><td>uvular</td>
125 <TD><b>phr</b></TD><td>pharyngeal</TD>
126 <TD><b>glt</b></TD><td>glottal</TD></tr>
127
128 </table>
129 <p>
130 <dt><strong>starttype</strong> &lt;phoneme&gt;
131 <dd>Allocates this phoneme to a group so that conditions such as nextPh(#e) can test for any of a group of phonemes. Pre-defined groups for use for vowels are: #@ #a #e #i #o #u. Additional groups can be defined as phonemes with type "virtual".
132 <p>
133 <dt><strong>endtype</strong> &lt;phoneme&gt;
134 <dd>Allocates this phoneme to a group so that conditions such as prevPh(#e) can test for any of a group of phonemes. Pre-defined groups for use for vowels are: #@ #a #e #i #o #u. Additional groups can be defined as phonemes with type "virtual".
135 <p>
136 <dt><strong>lengthmod</strong> &lt;integer&gt;
137 <dd>(C) Determines how this consonant affects the length of the previous vowel. This value is used as index into the <code>length_mods</code> table in the <code>CalcLengths()</code> function in the eSpeak program.
138 <p>
139 <dt><strong>voicingswitch</strong> &lt;phoneme&gt;
140 <dd>This is used for some languages to change between voiced and unvoiced phonemes.
141
142 </dl>
143 </ul>
144
145 <p>&nbsp;<hr>
146 <h3>Phoneme Instructions</h3>
147
148 Phoneme Instructions may be included within conditional statements.
149 <p>
150 During the first phase of phoneme interpretation, an instruction which causes a change to a different phoneme will terminate the instructions. During the second phase, FMT() and WAV() instructions will terminate the instructions.
151 <ul>
152 <dl>
153 <dt><strong>length</strong> &lt;length&gt;
154 <dd>The relative length of the phoneme, typically about 140 for a short vowel and from 200 to 300 for a long vowel or diphong. A length() instruction is needed for vowels. It is optional for consonants.
155 <p>
156 <dt><strong>ipa</strong> &lt;ipa string&gt;
157 <dd>In many cases, eSpeak makes IPA (International Phonetic Alpbabet) phoneme names automatically from eSpeak phoneme names. If this is not correct, then the phoneme definition can include an <b>ipa</b> instruction to specify the correct IPA name. IPA strings may include non-ascii characters. They may also include characters specified by their character codes in the form U+ followed by 4 hexadecimal digits. For example a string: aU+0303 indicates 'a' with a 'combining tilde'.
158 <p>
159 <dt><strong>WAV</strong>(&lt;wav file&gt;, &lt;amplitude&gt;)
160 <dd>&nbsp;&lt;wav file&gt; is a path to a WAV file (22 kHz, 16 bits, mono) within <code>phsource/</code> which will be played to produce the sound. This method is used for unvoiced consonants. &lt;wavefile&gt; does not include a .WAV filename extension, although the file to which it refers may or may not have one.<br>
161 &lt;amplitude&gt; is optional. It is a percentage change to the amplitude of the WAV file. So, <code>WAV(ufric/s, 50)</code> means: play file 'ufric/s.wav' at 50% amplitude.
162 <p>
163 <dt><strong>FMT</strong>(&lt;vowel file&gt;, &lt;amplitude&gt;)
164 <dd>&lt;vowel file&gt; is a path to a file (within <code>phsource/</code>) which defines how to generate the sound (a vowel or voiced consonant) from a sequence of formant values. Vowel files are made using the espeakedit program.<br>
165 &lt;amplitude&gt; is optional. It is a percentage change to the amplitude of the sound which is synthesized from the FMT() instruction.
166 <p>
167 <dt><strong>FMT</strong>(&lt;vowel file&gt;, &lt;amplitude&gt;) <strong>addWav</strong>(&lt;wav file&gt;, &lt;amplitude&gt;)
168 <dd>For voiced consonants, a FMT() instruction may be followed by an addWav() instruction. addWav() has the same format as a WAV() instruction, but the WAV file is mixed with the sound which is synthesized from the FMT() instruction.
169 <p>
170 <dt><strong>VowelStart</strong>(&lt;vowel file&gt;, &lt;length adjust&gt;)
171 <dd>This is used to modify the start of a vowel when it follows a sonorant consonant (such as [l] or [j]). It replaces the first frame of the &lt;vowel file&gt; which is specified in a FMT() instruction by this &lt;vowel file&gt;, and adjusts the length of the original by a signed value &lt;length adjust&gt;. The VowelStart() instruction may be specified either in the phoneme definition of the vowel, or in the phoneme definition of the sonorant consonant which precedes the vowel. The former takes precedence.
172 <p>
173 <dt><strong>VowelEnding</strong>(&lt;vowel file&gt;, &lt;length adjust&gt;)
174 <dd>This is used to modify the end of a vowel when it is followed by a sonorant consonant (such as [l] or [j]). It is appended to the &lt;vowel file&gt; which is specified in a FMT() instruction by this &lt;vowel file&gt;, and adjusts the length of the original by a signed value &lt;length adjust&gt;. The VowelEnding() instruction may be specified either in the phoneme definition of the vowel, or in the phoneme definition of the sonorant consonant which follows the vowel. The former takes precedence.
175 <p>
176 <dt><strong>Vowelin</strong> &lt;vowel transition data&gt;
177 <dd>(C) Specifies the effects of this consonant on the formants of a following vowel. See "vowel transitions", below.
178 <p>
179 <dt><strong>Vowelout</strong> &lt;vowel transition data&gt;
180 <dd>(C) Specifies the effects of this consonant on the formants of a preceding vowel. See "vowel transitions", below.
181 <p>
182 <dt><strong>ChangePhoneme(</strong>&lt;phoneme&gt;)
183 <dd>Change to the specified phoneme.
184 <p>
185 <dt><strong>ChangeIfDiminished(</strong>&lt;phoneme&gt;)
186 <dd>Change to the specified phoneme (such as schwa, @) if this syllable has "diminished" stress.
187 <p>
188 <dt><strong>ChangeIfUnstressed(</strong>&lt;phoneme&gt;)
189 <dd>Change to the specified phoneme if this syllable has "diminished" or "unstressed" stress.
190 <p>
191 <dt><strong>ChangeIfNotStressed(</strong>&lt;phoneme&gt;)
192 <dd>Change to the specified phoneme if this syllable does not have "primary" stress.
193 <p>
194 <dt><strong>ChangeIfStressed(</strong>&lt;phoneme&gt;)
195 <dd>Change to the specified phoneme if this syllable has "primary" stress.
196 <p>
197 <dt><strong>IfNextVowelAppend(</strong>&lt;phoneme&gt;)
198 <dd>If the following phoneme is a vowel then this additional phoneme will be inserted before it.
199 <p>
200 <dt><strong>RETURN</strong>
201 <dd>Ends executions of instructions.
202 <p>
203 <dt><strong>CALL</strong> &lt;phoneme table&gt;/&lt;phoneme&gt;
204 <dd>Executes the instructions of the specified phoneme.
205
206 </dl>
207 </ul>
208 <p>&nbsp;<hr>
209 <h3>Conditional Statements</h3>
210 Phoneme definitions can contain conditional statements such as:
211 <pre>
212 IF &lt;condition&gt; THEN
213 &lt;statements&gt;
214 ENDIF
215 </pre>
216 or more generally:
217 <pre>
218 IF &lt;condition&gt; THEN
219 &lt;statements&gt;
220 ELIF &lt;condition&gt; THEN
221 &lt;statements&gt;
222 ...
223 ELSE
224 &lt;statements&gt;
225 ENDIF
226 </pre>
227 where the <code>ELSE</code> and multiple <code>ELSE</code> parts are optional.
228 <p>
229 Multiple conditions may be joined with <code>AND</code> or <code>OR</code>, but not a mixture of <code>AND</code>s and <code>OR</code>s.
230 <p>
231 <strong>Condition</strong>
232 Can be:
233 <ul>
234 <dl>
235 <dt>prevPh(&lt;attribute&gt;)
236 <dd>Test the previous phoneme
237 <p>
238 <dt>prevPhW(&lt;attribute&gt;)
239 <dd>Test the previous phoneme, but only within the same word. Returns false if there is no previous phoneme in the word.
240 <p>
241 <dt>thisPh(&lt;attribute&gt;)
242 <dd>Test this current phoneme
243 <p>
244 <dt>nextPh(&lt;attribute&gt;)
245 <dd>Test the following phoneme
246 <p>
247 <dt>nextPhW(&lt;attribute&gt;)
248 <dd>Test the following phoneme, but only within the same word. Returns false if there is no following phoneme in the word.
249 <p>
250 <dt>next2Ph(&lt;attribute&gt;)
251 <dd>Test the phoneme after the next phoneme.
252 <p>
253 <dt>nextVowel(&lt;attribute&gt;)
254 <dd>Test the next vowel after the current phoneme, but only within the same word. Returns false if there is none.
255 <p>
256 <dt>PreVoicing()
257 <dd>This is used as part of the instructions for voiced stop consonants (eg. [d] [g]). If true then produce a voiced murmur before the stop.
258 <p>
259 <dt>KlattSynth()
260 <dd>Returns true if the voice is using the Klatt synthesizer rather than the eSpeak synthesizer.
261 </dl>
262 </ul>
263 <strong>Attributes</strong>
264 <ul>
265 Note: Additional attributes could be added to eSpeak if needed.
266 <dl>
267 <dt>&lt;phoneme name&gt;
268 <dd>True if the phoneme has this phoneme name.
269 <p>
270 <dt>&lt;phoneme group&gt;
271 <dd>True if the phoneme has this starttype (or if it has this endtype if it's used in prevPh() ). The pre-defined phoneme groups are #@, #a, #e, #i, #o, #u.
272 <p>
273 <dt>isPause
274 <dd>True if the phoneme is a pause.
275 <p>
276 <dt>isPause2
277 <dd><code>nextPh(isPause2)</code> is used to test whether the next phoneme is not a vowel or liquid consonant within the same word.
278 <p>
279 <dt>isVowel
280 <dt>isNotVowel
281 <dt>isLiquid
282 <dt>isNasal
283 <dt>isVFricative
284 <dd>These test the phoneme type.
285 <p>
286 <dt>isPalatal
287 <dt>isRhotic
288 <dd>These test whether the phoneme has this property.
289 <p>
290 <dt>isWordStart
291 <dt>notWordStart
292 <dd>These text whether this is the first phoneme in a word.
293 <p>
294 <dt>isWordEnd
295 <dd>True if this is the final phoneme in a word.
296 <p>
297 <dt>isFinalVowel
298 <dd>True if this is the last vowel in a word.
299 <p>
300 <dt>isAfterStress
301 <dd>True if this phoneme is after the stressed vowel in a word.
302 <p>
303 <dt>isVoiced
304 <dd>True if this phoneme is a vowel or a voiced consonant.
305 <p>
306 <dt>isDiminished
307 <dd>True if the syllable stress is "diminished"
308 <p>
309 <dt>isUnstressed
310 <dd>True if the syllable stress is "diminished" or "unstressed"
311 <p>
312 <dt>isNotStressed
313 <dd>True if the syllable stress is not "primary stress".
314 <p>
315 <dt>isStressed
316 <dd>True if the syllable stress is "primary stress".
317 <p>
318 <dt>isMaxStress
319 <dd>True if this is the highest stressed syllable in the word.
320 <p>
321 <dt>
322 <dd>
323
324 </dl>
325 </ul>
326
327 <p>&nbsp;<hr>
328 <h3>Sound Specifications</h3>
329 There are three ways to produce sounds:
330 <ul>
331 <li>Playing a WAV file, by using a WAV() instruction. This is used for unvoiced consonants such as <code> [p] [t] [s]</code>.
332 <li>Generating a wave from a sequence of formant parameters, by using a FMT() instruction.This is used for vowels and also for sonorants such as <code> [l] [j] [n]</code>.
333 <li>A mixture of these. A stored WAV file is mixed with a wave generated from formant parameters. Use a FMT() instruction followed by addWav(). This is used for voiced stops and fricatives such as <code> [b] [g] [v] [z]</code>.
334 </ul>
335 <p>&nbsp;<hr>
336 <h3>Vowel Transitions</h3>
337 These specify how a consonant affects an adjacent vowel. A consonant may cause a transition in the vowel's formants as the mouth changes shape between the consonant and the vowel. The following attributes may be specified. Note that the maximum rate of change of formant frequencies is limited by the speak program.<p>
338 <ul><dl>
339 <dt><strong>len=&lt;integer&gt;</strong>
340 <dd>Nominal length of the transition in mS. If omitted a default value is used.
341 <dt><strong>rms=&lt;integer&gt;</strong>
342 <dd>Adjusts the amplitude of the vowel at the end of the transition. If omitted a default value is used.
343 <dt><strong>f1=&lt;integer&gt;</strong>
344 <dd>
345 0: &nbsp; f1 formant frequency unchanged.<br>
346 1: &nbsp; f1 formant frequency decreases.<br>
347 2: &nbsp; f1 formant frequency decreases more.
348 <dt><strong>f2=&lt;freq&gt; &lt;min&gt; &lt;max&gt;</strong>
349 <dd>
350 &lt;freq&gt;: &nbsp; The frequency towards which the f2 formant moves (Hz).<br>
351 &lt;min&gt;: &nbsp; Signed integer (Hz).&nbsp; The minimum f2 frequency change.<br>
352 &lt;max&gt;: &nbsp; Signed integer (Hz).&nbsp; The maximum f2 frequency change.
353 <dt><strong>f3=&lt;change&gt; &lt;amplitude&gt;</strong>
354 <dd>
355 &lt;change&gt;: &nbsp; Signed integer (Hz).&nbsp; Frequence change of f3, f4, and f5 formants.<br>
356 &lt;amplitude&gt;: &nbsp; Amplitude of the f3, f4, and f5 formants at the end of the transition. 100 = no change.
357 <dt><strong>brk</strong>
358 <dd>Break. Do not merge the synthesized wave of the consonant into the vowel. This will produce a discontinuity in the formants.
359 <dt><strong>rate</strong>
360 <dd>Allow a greater maximum rate of change of formant frequencies.
361 <dt><strong>glstop</strong>
362 <dd>Indicates a glottal stop.
363 </dl></ul>
364 </body>
365 </html>