Tombuntu

The eSpeak Speech Synthesizer

A while ago I played with the Festival text-to-speech program. Now I’ve found a similar application called eSpeak, which is included in every default Ubuntu installation.

First, if you get errors like the ones below when running eSpeak, another sound application interfering with eSpeak. You’ll need to close any other applications using sound to use eSpeak.

PaHost_OpenStream: could not open /dev/dsp for O_WRONLY
PaHost_OpenStream: ERROR - result = -10000

Simply run eSpeak with a string of text in quotes to read:

espeak "The Linux kernel, pronounced 'linnuks' is the heart of the Ubuntu operating system."

The -sdtin option tells eSpeak to read text from the standard input. This lets you type text to be read interactively, or use output of another command as eSpeak text. This command will take a fortune and read it to you:

fortune | espeak -stdin

The -f option can be used to read a file. Read the release version of your Linux distribution:

espeak -f /etc/issue

Of course, eSpeak can use more that one voice, it even supports multiple languages. Use the -v option with a language code and optionally a variation, +m1 to +m6 for a male voice, and +f1 to +f4 for a female voice.

espeak -v en+f2 "The Linux kernel, pronounced 'linnuks' is the heart of the Ubuntu operating system."

You can use the -w option to save the output to a WAV audio file instead of reading it:

espeak -w helloworld.wav "Hello world"

Read the documentation for all of eSpeak’s options.

I checked, and yes, eSpeak can be run over SSH to remotely speak to people using your computer. Have fun!

Archived Comments

Vadim P.

“espeak -v en+m2” is the perfect combination for a scary voice.

Paradoxdruid

To avoid the /dev/dsp errors on this and similar programs, I use the alsa-oss program (in the Ubuntu repositories). Once installed, you simply preface your command with aoss, for instance:
‘aoss espeak -v en+f2 “Welcome to Linux” ‘

And alsa-oss wraps the command to use the alsa sound server properly. This lets you use espeak while other sound-using program are running.

espeak is a fun tool– thanks for the heads-up!

Tom Sheather

Actually, GNU *and* Linux are the heart of Ubuntu.
It would be great if you could credit it as such in future. :)

Tom

Tom Sheather:
You’ll have to talk to the Ubuntu documentation people, I just copied and pasted a line of text from this page:
https://help.ubuntu.com/7.10/about-ubuntu/C/about-linux.html

Anonymous

I’m running this right now:
w3m -dump http://somewebsite/rssfead | espeak

Respond via email