- 22
- Dec
If you are like me, and have a slight case of attention deficit disorder, you do not like to read for long periods of time. Text to speech can be a god send. By using Festival, we can easily convert text files to wav format with one command.

If you haven’t already, check out the Transform Linux into a Talking Companion post to learn how to install and use Festival.
Included in Festival is a command called text2wav. The output of cat can be redirected into text2wave to produce TTS wav files.
How to convert text files to wav files with text2wave:
- Copy and paste the chosen text into a new text file. Name it something simple like tts.txt
- Next, open a terminal and cd into the directory that you have save the tts.txt file to
- Now, type the follwing command to convert the text to wav format — cat tts.txt | text2wave -o tts.wav
- If all went well, you should have a new file in the same directory called tts.wav. Congratulations, you just converted your first text file to wav using Festival!
Since wav files are huge, you may want to consider using lame to convert to MP3 if you plan on keeping or sharing your TTS audio files. You will need to install it and the command is very simple — lame tts.wav tts.mp3
I hope you find this as useful as I do. Forget about buying the audio book next time; if you can find the ebook, just make your own.
Text-to-speech is really convenient, especially when you are lazy like me. 

