PageRenderTime 46ms CodeModel.GetById 13ms app.highlight 20ms RepoModel.GetById 2ms app.codeStats 0ms

/native/external/espeak/docs/commands.html

http://eyes-free.googlecode.com/
HTML | 197 lines | 193 code | 4 blank | 0 comment | 0 complexity | 571e71b615d8aebcafbf82915c802532 MD5 | raw file
  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 Speech Synthesizer</title>
  6  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7</head>
  8<body>
  9<A href="index.html">Back</A>
 10<hr>
 11<h2>2.1 INSTALLATION</h2>
 12<hr>
 13<h3>2.1.1 Linux and other Posix systems</h3>
 14There are two versions of the command line program. They both have the same command parameters (see below).
 15<ol>
 16<li><strong>espeak</strong> uses speech engine in the <strong>libespeak</strong> shared library.  The libespeak library must first be installed.
 17<p>
 18<li><strong>speak</strong> is a stand-alone version which includes its own copy of the speech engine.
 19</ol>
 20Place the <strong>espeak</strong> or <strong>speak</strong> executable file in the command path, eg in <strong>/usr/local/bin</strong>
 21<p>
 22Place the "<strong>espeak-data</strong>" directory in /usr/share as <strong>/usr/share/espeak-data</strong>.<br>
 23Alternatively if it is placed in the user's home directory (i.e. <strong>/home/&lt;user&gt;/espeak-data</strong>)
 24then that will be used instead.
 25<p>
 26<h4>Dependencies</h4>
 27<strong>espeak</strong> uses the PortAudio sound library (version 18), so you will need to have the <strong>libportaudio0</strong> library package installed.  It may be already, since it's used by other software, such as OpenOffice.org and the Audacity sound editor.<p>
 28Some Linux distrubitions (eg. SuSe 10) have version 19 of PortAudio which has a slightly different API. The speak program can be compiled to use version 19 of PortAudio by copying the file portaudio19.h to portaudio.h before compiling.<p>
 29 The speak program may be compiled without using PortAudio, by removing the line<pre>   #define USE_PORTAUDIO
 30</pre>in the file speech.h. 
 31<p>&nbsp;<hr>
 32<h3>2.1.2 Use with KDE Text-to-Speech (KTTS)</h3>
 33To add to KDE-Text-to-Speech Manager (KTTSMgr), use it as a "Command" talker
 34with "command for speaking texts" set to:<br>
 35   <strong>cat %f | espeak --stdin -w %w -v en -s190</strong>
 36<p>
 37In this example, "en" is the voice name, "190" is the speed.
 38<p>
 39Note:
 40<ul>
 41<li>When used by the KTTS system, I noticed a slight background hiss with the speech, which is not present when I use <strong>espeak</strong> directly from the command line. This was because KDE sound default was set to "8 bits" rather than 16 bits.<p>
 42<li>KTTSMgr breaks the text into sentences to pass to the speech engine, but it mistakenly assumes sentence breaks when dots follow abbreviations and therefore pauses after the dots in "eg. Mr. John B. Smith etc."  Speaking a text file directly with <strong>espeak</strong> gives better results in this respect.
 43
 44</ul>
 45<p>&nbsp;<hr>
 46<h3>2.1.3 Windows</h3>
 47The installer: <strong>setup_espeak.exe</strong> installs the SAPI5 version of eSpeak.  It also installs a command line program <strong>espeak</strong> in the espeak directory.
 48
 49<p>&nbsp;<hr>
 50<h2>2.2 COMMAND OPTIONS</h2>
 51<hr>
 52<h3>2.2.1 Examples</h3>
 53To use at the command line, type:<br>
 54 &nbsp; <strong>espeak "This is a test"</strong><br>
 55or<br>
 56 &nbsp; <strong>espeak -f &lt;text file&gt;</strong>
 57<p>
 58Or just type<br>
 59 &nbsp; <strong>espeak</strong><br>
 60followed by text on subsequent lines. Each line is spoken when
 61RETURN is pressed.<br>Use <strong>espeak -x</strong> to see the corresponding phoneme codes.
 62<p>&nbsp;<hr>
 63<h3>2.2.2 The Command Line Options</h3>
 64<dl>
 65<dt>
 66<strong>espeak [options] ["text words"]</strong><br>
 67<dd>Text input can be taken either from a file, from a string in the command, or from stdin.
 68<p>
 69<dt>
 70<strong>-f &lt;text file&gt;</strong><br>
 71<dd>Speaks a text file.
 72<p>
 73<dt>
 74<strong> --stdin</strong><br>
 75<dd>Takes the text input from stdin.
 76<p>
 77<dt>
 78If neither -f nor --stdin is given, then the text input is taken from "text words" (a text string within double quotes). <br>If that is not present then text is taken from stdin, but each line is treated as a separate sentence.
 79<p>
 80<dt>
 81<strong>-a &lt;integer&gt;</strong><br>
 82<dd>Sets amplitude (volume) in a range of 0 to 200.  The default is 100.
 83<p>
 84<dt>
 85<strong>-p &lt;integer&gt;</strong><br>
 86<dd>Adjusts the pitch in a range of 0 to 99.  The default is 50.
 87<p>
 88<dt>
 89<strong>-s &lt;integer&gt;</strong><br>
 90<dd>Sets the speed in words-per-minute (approximate values for the default English voice, others may differ slightly). The default value is 170. I generally use a faster speed
 91of 190.  Range 80 to 390.
 92<p>
 93<dt>
 94<strong>-b</strong><br>
 95<dd>Indicates that the input text is not UTF-8, but the 8-bit character set which corresponds to the language (eg. Latin-2 for Polish). Without this option, eSpeak assumes text is UTF8, but will automatically switch to the 8-bit character set if it finds an illegal UTF8 sequence.  That may give wrong results if some 8-bit character sequences look like valid UFT8 multibyte characters.
 96<p>
 97<dt>
 98<strong>-g &lt;integer&gt;</strong><br>
 99<dd>Word gap.  This option inserts a pause between words.  The value is the length of the pause, in units of 10 mS (at the default speed of 170 wpm).
100<p>
101<dt>
102<strong>-k &lt;integer&gt;</strong><br>
103<dd>Indicate words which begin with capital letters.<p>
1041 &nbsp; eSpeak uses a click sound to indicate when a word starts with a capital letter, or double click if word is all capitals.<p>
1052 &nbsp; eSpeak speaks the word "capital" before a word which begins with a capital letter.<p>
106Other values: &nbsp; eSpeak increases the pitch for words which begin with a capital letter. The greater the value, the greater the increase in pitch.  Try -k20.
107<p>
108<dt>
109<strong>-l &lt;integer&gt;</strong><br>
110<dd>Line-break length, default value 0.  If set, then lines which are shorter
111than this are treated as separate clauses and spoken separately with a
112break between them.  This can be useful for some text files, but bad for
113others.
114<p>
115<dt>
116<strong>-m</strong><br>
117<dd>Indicates that the text contains SSML (Speech Synthesis Markup Language) tags or other XML tags.  Those SSML tags which are supported are interpreted.  Other tags, including HTML, are ignored, except that some HTML tags such as &lt;hr&gt; &lt;h2&gt; and &lt;li&gt; ensure a break in the speech.
118<p>
119<dt>
120<strong>-q</strong><br><dd>
121Quiet. No sound is generated.  This may be useful with the -x option.
122<p>
123<dt>
124<strong>-v &lt;voice filename&gt;[+&lt;variant&gt;]</strong><br>
125<dd>Sets a Voice for the speech, usually to select a language. eg:
126<pre>   espeak -vaf</pre>
127To use the Afrikaans voice.  A modifier after the voice name can be used to vary the tone of the voice, eg:
128<pre>   espeak -vaf+3</pre>
129The variants are <code> +m1  +m2  +m3  +m4  +m5  +m6 </code> for male voices and <code> +f1 +f2 +f3 +f4 </code> which simulate female voices by using higher pitches. Other variants are <code>+croak</code> and <code>+whisper</code>.
130<p>
131&lt;voice filename&gt; is a file within the <code>espeak-data/voices</code> directory.<br>
132&lt;variant&gt; is a file within the <code>espeak-data/voices/!v</code> directory.<p>
133Voice files can specify a language, alternative pronunciations or phoneme sets, different pitches, tonal qualities, and prosody for the voice.
134See the <a href="voices.html">voices.html</a> file.<p>
135Voice names which start with <b>mb-</b> are for use with Mbrola diphone voices, see <a href="mbrola.html">mbrola.html</a><p>
136Some languages may need additional dictionary data, see <a href="languages.html">languages.html</a>
137<p>
138<dt>
139<strong>-w &lt;wave file&gt;</strong><br>
140<dd>Writes the speech output to a file in WAV format, rather than speaking it.
141<p>
142<dt>
143<strong>-x</strong><br>
144<dd>The phoneme mnemonics, into which the input text is translated, are
145shown on stdout.
146<p>
147<dt>
148<strong>-X</strong><br>
149<dd>As -x, but in addition, details are shown of the pronunciation rule and dictionary list lookup.  This can be useful to see why a certain pronunciation is being produced.  Each matching pronunciation rule is listed, together with its score, the highest scoring rule being used in the translation.  "Found:" indicates the word was found in the dictionary lookup list, and "Flags:" means the word was found with only properties and not a pronunciation.  You can see when a word has been retranslated after removing a prefix or suffix.
150<p>
151<dt>
152<strong>-z</strong><br>
153<dd>The option removes the end-of-sentence pause which normally occurs at the end of the text.
154<p>
155<dt>
156<strong>--stdout</strong><br>
157<dd>Writes the speech output to stdout as it is produced, rather than speaking it.  The data starts with a WAV file header which indicates the sample rate and format of the data.  The length field is set to zero because the length of the data is unknown when the header is produced.
158<p>
159<dt><strong>--compile [=&lt;voice name&gt;]</strong><br>
160<dd>
161Compile the pronunciation rule and dictionary lookup data from their source files in the current directory.  The Voice determines which language's files are compiled.  For example, if it's an English voice, then <em>en_rules</em>, <em>en_list</em>, and <em>en_extra</em> (if present), are compiled to replace <em>en_dict</em>  in the <em>speak-data</em> directory.  If no Voice is specified then the default Voice is used.
162<p>
163<dt><strong>--compile-debug [=&lt;voice name&gt;]</strong><br>
164<dd>
165The same as <strong>--compile</strong>, but source line numbers from the *_rules file are included.  These are included in the rules trace when the <strong>-X</strong> option is used.
166<p>
167<dt><strong>--punct [="&lt;characters&gt;"]</strong><br>
168<dd>
169Speaks the names of punctuation characters when they are encountered in the text.  If &lt;characters&gt; are given, then only those listed punctuation characters are spoken, eg.  <code> --punct=".,;?"</code>
170<p>
171<dt><strong>--split [="&lt;minutes&gt;"]</strong><br>
172<dd>
173Used with <strong>-w</strong>, it starts a new WAV file every <code>&lt;minutes&gt;</code> minutes, at the next sentence boundary.
174<p>
175<dt>
176<strong>--voices [=&lt;language code&gt;]</strong><br>
177<dd>Lists the available voices.<br>
178If =&lt;language code&gt; is present then only those voices which are suitable for that language are listed.<br>
179<code>--voices=mbrola</code> lists the voices which use mbrola diphone voices. These are not included in the <code>--voices</code> list<br>
180<code>--voices=variant</code> lists the voice variants (voice modifiers).<br>
181
182</dl>
183<p>&nbsp;<hr>
184<h3>2.2.3 The Input Text</h3>
185<dl>
186<dt><b>HTML Input</b>
187<dd>
188If the -m option is used to indicate marked-up text, then HTML can be spoken directly.
189<p>
190<dt><b>Phoneme Input</b>
191<dd>
192As well as plain text, phoneme mnemonics can be used in the text input to <strong>espeak</strong>.  They are enclosed within double square brackets.  Spaces are used to separate words and all stressed syllables must be marked explicitly.<p>
193 &nbsp; eg: &nbsp; <code> espeak -v en [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]] </code><p>
194 ("This is some phonetic text input").
195</dl>
196</body>
197</b>