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!