eSpeak-ng options in Linux

Lalita Rajpoot
6 min readSep 19, 2021

--

eSpeak: Text To Speech Tool For Linux:-

eSpeak is a command line tool for Linux that converts text to speech. This is a compact speech synthesizer that provides support to English and many other languages. It is written in C.

eSpeak reads the text from the standard input or the input file. The voice generated, however, is nowhere close to a human voice. But it is still a compact and handy tool if you want to use it in your projects.

eSpeak NG is available as:

  • A command line program (Linux and Windows) to speak text from a file or from stdin.
  • A shared library version for use by other programs. (On Windows this is a DLL).
  • A SAPI5 version for Windows, so it can be used with screen-readers and other programs that support the Windows SAPI5 interface.
  • eSpeak NG has been ported to other platforms, including Solaris and Mac OSX.

Some of the main features of eSpeak are:

  • A command line tool for Linux and Windows
  • Speaks text from a file or from stdin
  • Shared library version for use by other programs
  • SAPI5 version for Windows, so it can be used with screen-readers and other programs that support the Windows SAPI5 interface.
  • Various voice characteristics to choose from

The eSpeak speech synthesizer supports over 70 languages, however in many cases these are initial drafts and need more work to improve them. Assistance from native speakers is welcome for these, or other new languages.

History

The program was originally known as speak and originally written for Acorn/RISC_OS computers starting in 1995 by Jonathan Duddington. This was enhanced and re-written in 2007 as eSpeak, including a relaxation of the original memory and processing power constraints, and with support for additional languages.

In 2010, Reece H. Dunn started maintaining a version of eSpeak on GitHub that was designed to make it easier to build eSpeak on POSIX systems, porting the build system to autotools in 2012. In late 2015, this project was officially forked to a new eSpeak NG project. The new eSpeak NG project is a significant departure from the eSpeak project, with the intention of cleaning up the existing codebase, adding new features, and adding to and improving the supported languages.

Options

-h — help

espeak-ng -h 

Show summary of options.

--version

espeak-ng --version

`Prints the espeak library version and the location of the espeak voice data.

-f <text file>

espeak-ng -f lw.txt

Text file to speak. It will speak the text of the file

Text to speak

--stdin

Read text input from stdin instead of a file.

If neither -f nor - -stdin are provided, <words> are spoken, or if no words are provided then text is spoken from stdin a line at a time.

-d <device>

Use the specified device to speak the audio on. If not specified, the default audio device is used.

-q

espeak-ng -q lw.txt

Quiet, don´t produce any speech (may be useful with -x).

-a<integer>

Amplitude, 0 to 200, default is 100.

-q <integer>

Word gap. Pause between words, units of 10ms at the default speed.

-k <integer>

Indicate capital letters with: 1=sound, 2=the word “capitals”, higher values = a pitch increase (try -k20).

-l <integer>

Line length. If not zero (which is the default), consider lines less than this length as end-of-clause.

-p<integer>

Pitch adjustment, 0 to 99, default is 50.

-s <integer>

Speed in words per minute, default is 175.

-v<voice name>

espeak-ng -v hi+m3 "lalita"

Use voice file of this name from espeak-ng-data/voices. A variant can be specified using voice+variant, such as af+m3.

-w<wave file name>

Write output to this WAV file, rather than speaking it directly.

- -split=<minutes>

Used with -w to split the audio output into <minutes> recorded chunks.

-b

Input text encoding, 1=UTF8, 2=8 bit, 4=16 bit.

-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

-x

espeak-ng -x student

Write phoneme mnemonics to stdout.

-X

espeak-ng -X student

Write phonemes mnemonics and translation trace to stdout. If rules files have been built with --complie=debug, line numbers will also be displayed.

-z

espeak-ng -z student

No final sentence pause at the end of the text.

- -stdout

speak-ng --stdout student

Write speech output to stdout.

compile- -=voicename

Compile the pronunciation rules and dictionary in the current directory. =<voicename< is optional and specifies which language is compiled.

- -compiledebug=voicename

Compile the pronunciation rules and dictionary in the current directory as above, but include line numbers, that get shown when -X is used.

- -ipa

espeak-ng -ipa student

Write phonemes to stdout using International Phonetic Alphabet. --ipa=1 Use ties,- -ipa=2 Use ZWJ,- -ipa=3 Separate with _.

- -tia=<character>

The character to use to join multi-letter phonemes in -x and- -ipa output.

- -path=<path>

Specifies the directory containing the espeak-ng-data directory.

- -pho

Write mbrola phoneme data (.pho) to stdout or to the file in - -phonout

- -phonout t=<filename>

Write output from -x-Xcommands and mbrola phoneme data to this file.

- -punct=”<characters>”

Speak the names of punctuation characters during speaking. If =<characters> is omitted, all punctuation is spoken.

- -sep=<character>

The character to separate phonemes from the -x and- -ipaoutput.

- -voices[=<language code>]

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

- -voices=<directory>

Lists the voices in the specified subdirectory.

Examples

espeak-ng “This is an article”

Speak the sentence “This is an article” using the default English voice.

espeak-ng -f file.txt

Speak the contents of file.txt using the default English voice.

cat hello.txt | espeak-ng

Speak the contents of hello.txt using the default English voice.

espeak-ng -x student

Speak the word “student” using the default English voice, and print the phonemes that were spoken.

espeak-ng -ven-us “[[h@´loU]]”

Speak the phonemes “h@´loU” using the American English voice.

espeak-ng - -voices

List all voices supported by eSpeak.

espeak-ng - - voices

List all voices

Example:- Afrikaans, Albanian, Arabic, Bengali, Chinese, Dutch, English, French, Hindi, Greek, etc..

espeak-ng - -voices=mb

List all voices using the MBROLA voice synthesizer.

Thanks to giving your time to read this article !!

--

--

Lalita Rajpoot
Lalita Rajpoot

No responses yet