Saturday, May 11, 2013

Speech Synthesis on the Raspberry PI

Here is a quick and simple tip to add speech output to jazz up your Raspberry PI projects.  It is easy as installing the "festival" Text to Speech (TTS) application then calling it from the command line or Python script.

To install "festival" you need to be at a terminal prompt on the Raspberry PI.  Then type:
$ sudo apt-get install festival festival-freebsoft-utils
You will get asked to confirm the install.  Type "Y".

To make the PI talk, just issue a command from the terminal prompt, such as:
$ echo  "Whiskey Tango Hotel dot com Where stupidity meets reality"| festival --tts
That's it.  Of course, you can also execute this from a Python script, etc.

Here's a sample of the output.  Sounds pretty good to me.