Text to speech has been around for a number of years. While you may not want to add text to speech to all of your shell scripts you may have a particular script that would be nice to get some audio feedback from. There are a couple of text-to-speech engines that run in the shell, but my favorite is flite. It is really simple to install and use and has a decent set of voices. You can add other voices or compile your own with FestVox.
Here is how to use flite from the shell to directly play the text:
[owen@TheLinuxBlog ~]$ flite -t "Thanks for reading The Linochs Blog"
Notice the misspelling of the word Linux. If flite doesn’t correctly output the words, you can sometimes use phonetics to get a better result.
You can also play text files by using the -f option.
[owen@TheLinuxBlog ~]$ flite -t "Thanks for reading The Linochs Blog" flite: pcm_params.c:2333: sndrv_pcm_hw_params: Assertion `err >= 0' failed.