Back

2.1 INSTALLATION


Place the "speak" executable file in the command path, eg in /usr/local/bin

Place the "espeak-data" directory in /usr/share as /usr/share/espeak-data.
Alternatively if it is placed in the user's home directory (i.e. /home/<user>/espeak-data) then that will be used instead.

Dependencies

speak uses the PortAudio sound library (version 18), so you will need to have the libportaudio0 library package installed. It may be already, since it's used by other software, such as OpenOffice.org and the Audacity sound editor.

Some 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.

The speak program may be compiled without using PortAudio, by removing the line

   #define USE_PORTAUDIO
in the file speech.h.

 


2.2 COMMAND OPTIONS


2.2.1 Examples

To use at the command line, type:
  speak "This is a test"
or
  speak -f <text file>

Or just type
  speak
followed by text on subsequent lines. Each line is spoken when RETURN is pressed.
Use speak -x to see the corresponding phoneme codes.

 


2.2.2 Use with KDE Text-to-Speech (KTTS)

To add to KDE-Text-to-Speech Manager (KTTSMgr), use it as a "Command" talker with "command for speaking texts" set to:
cat %f | speak --stdin -w %w

Note:

 


2.2.3 The Command Line Options

speak [options] ["words"]
Text input can be taken either from a file, from a string in the command, or from stdin.

-f <text file>
Speaks a text file.

--stdin
Takes the text input from stdin.

If neither -f nor --stdin is given, then the text input is taken from "words" (a text string within double quotes).
If that is not present then text is taken from stdin, but each line is treated as a separate sentence.

-a <integer>
Sets amplitude (volume) in a range of 0 to 200. The default is 100.

-p <integer>
Adjusts the pitch in a range of 0 to 99. The default is 50.

-s <integer>
Sets the speed in words-per-minute (for the default voice, others may differ slightly). The default value is 160. I generally use a faster speed of 168. Range 80 to 320.

-l <integer>
Line-break length, default value 0. If set, then lines which are shorter than this are treated as separate clauses and spoken separately with a break between them. This can be useful for some text files, but bad for others.

-m
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 <hr> <h2> and <li> ensure a break in the speech.

-v <voice filename>
Sets a Voice for the speech. <voice filename> is a file within the espeak-data/voices directory.
Voice files can specify a language, different pitches, tonal qualities, and prosody for the voice. See the "docs/voices.html" file.

-w <wave file>
Writes the speech output to a file in WAV format, rather than speaking it.

--stdout
Writes the speech output to stdout rather than speaking it.

-x
The phoneme mnemonics, into which the input text is translated, are shown on stdout.

-X
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.

-q
Quiet. No sound is generated. This may be useful with the -x option.

--compile[=<voice name>]
Compile 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 en_rules, en_list, and en_extra (if present), are compiled to replace en_dict in the speak-data directory. If no Voice is specified then the default Voice is used.

--punct[="<characters>"]
Speaks the names of punctuation characters when they are encountered in the text. If <characters> are given, then only those listed punctuation characters are spoken, eg. --punct=".,;?"

--voices[=<language code>]
Lists the available voices.
If =<language code> is present then only those voices which are suitable for that language are listed.

 


2.2.4 The Input Text

If the -m option is used to indicate marked-up text, then HTML can be spoken directly.

As well as plain text, phoneme mnemonics can be used in the text input to speak. They are enclosed within double square brackets. Spaces are used to separate words and all stressed syllables must be marked explicitly.
  eg: [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]