Mac OS X "say" command in Ubuntu?

Is there an equivalent to the Mac's terminal command "say" in Ubuntu 9.10?


espeak should be installed by default as text-to-speech engine on Linux.

You should be able to get it to speak from command-line by doing something like this:

echo "Text to speak"|espeak

You can also start espeak by just entering espeak itself, and then enter each line of text you want spoken followed by enter.

Other TTS engines for Linux you could look at:

  • http://www.cstr.ed.ac.uk/projects/festival/
  • http://epos.ure.cas.cz/

Espeak is available at (but should be installed by default!):

  • http://espeak.sourceforge.net/

alias say='echo "$1" | espeak -s 120 2>/dev/null'

Then you can use:

say 'How are you doing?'

Explanation:

-s 120 #to make it slower than default
2>/dev/null #to eliminate error masseges on the console

There are a number of speech synthesizers available to install in karmic, most of the ones I've tried have a console version.

Search for "Speech" in synaptic to get the full list. The espeak package works like say.


install speech-dispatcher along with a synthesizer (flite, festival, etc) then

alias say='echo "$1" | spd-say -p -25 -e'

that will use whatever synthesizer you have configured.

The -p -25 is setting the pitch lower... change as desired. -e uses stdin