Festival - Speech Synthesis System - tutorial

Updated: October 15, 2010

Text-to-speech conversion may not seem that important to you, but it is. Apart from allowing visually impaired people to enjoy computers, it has other uses, too. Imagine you're in a car, hopefully not driving, and fancy a read. Only you kind of get dizzy when you try this. Or perhaps you would like to add an audio dimension to your tutorials with speech replacing long lines of text.

Teaser

Festival does just that. It's a Speech Synthesis System, allowing you to convert text to speech. Festival is quite handy. It allows scripting and has APIs for several programming languages. Currently, Festival sports several male and female voices in American and British English and early support for Spanish.

Let's take a look.

Festival in action

Festival is available in the repositories of most major distribution, so the installation should not be a problem. Festival is a command line tool, with no graphical interface. Using it does not take rocket science, but you should consult the online manual for basic instructions.

In general, Festival runs in interactive mode. You launch the program and then tell it what to say. But you can also run the program against files, like books or papers, or pipe text from other applications into Festival.

Interactive mode

Start Festival by typing festival on the command line.

Then to make it say things, run the following command:

(SayText "your text here")

Here's a screenshot example:

Interactive

File mode

Instead of typing long lines of text at the command line, you can run Festival against a text line. Really useful for audio books, seminar material and suchlike.

Here's a sample file:

File

And then, run Festival against this file:

festival --tts <file>

Record the text-to-speech

You can feed the Festival sound to your sound recording software to create audio files, which you can later process as you see fit. For instance, you can use the Gnome Sound Recorder to do just that.

Recorded

Here's a 12-second sample recorded in this fashion.

festival-demo.ogg, 12 sec, 253KB

Thumb

Now, the best part, you can really skip all of the above. Festival comes with a built-in script that will automatically create .wav files from input text. The script is called text2wave.

text2wave <file> -o <output.wav>

text2wave

Voices

There are several voices available. You can also try the online demo to see what they sound like. In general, I found the British voices to be more realistic, more streamlined and easier to understand. But it's your choice entirely.

Conclusion

Festival is a very handy software, simple and useful. Even if you do not see an immediate use in the program, you can consider introducing it into your own arsenal of multimedia tools, whether for practical purposes, like audio-video lectures, tutorials or just fun.

I hope you liked this guide. Now that we know a little more about text-to-speech software, we'll soon examine Orca the screen reader software in Linux and take a look at other accessibility features. For now, you can take a look at Knoppix Adriane, specially designed for visually impaired users.

Cheers.