Search My Blog

Wednesday, November 10, 2010

Festival - A Text to Speech synthesis software in Linux | All about Linux

So far, Festival is the only Text to Speech App that I can get to work on my Fedora 13 System. But, it is a Pain since it is a Command Line App. The "festival --tts myfile.txt" command worked fine. But it sounds like Crap!:O The Commands in this Article did get me up and Seeking - Listening though. At first I kept getting errors on the file I was trying to listen to. But then I remembered that Linux Command line Apps don't like File names with Spaces in them. So I renamed the file and added "-" where the spaces were and then Festival Spoke to me just fine. I tried the "less myfile.pdf | festival --tts" Commands (from the comments) and Festival did play my PDF file. But it was reading some kind of hidden Text or the Code in the file, I'm not sure. But it was saying "000010000..." forever. The "CTRL-Z and restart by typing 'bg' or 'fg" Helped out allot in that instance. Kept me from throwing something through my Monitor! After Listening to that Droning Festival Voice for about 30 Seconds:O I have heard much better Speech Voices in my Past Linux Systems and I have to admit that the Windows Text to Speech Apps work great and Sound Much Much Better since 1998! But I still haven't found the Apps I use to use. Or I have just forgotten how I set the others like KMouth up to work back when I was running Fedora 7 and Debian a few of years ago...


January 24, 2006

Festival - A Text to Speech synthesis software in Linux

What is Festival ?

Festival is a free text to speech synthesizer developed by the Center for Speech Technology Research at the University of Edinburgh.

It is shipped with most Linux distributions and has been released under an X11-type license allowing unrestricted commercial and non-commercial use alike.

Text to speech synthesizer is a computer program that converts normal language text into speech.

Coming home after a hard day at work after staring at the monitor continuously for hours on end, the last thing I want to do many days is sit in front of the computer again. At times though, I have this urge to grab a book and do some light reading but often the strain on my eyes dissuades me in pursuing this thought any further. This is where this very nice utility called Festival comes into the picture.

Festival TTS Basic Usage

When you run festival, it converts the contents of a text file into voice. For example, if I want to read a letter (mail) which is residing in a text file (say letter.txt). I can let festival read it out loud for me as follows:

$ festival --tts letter.txt

One way I put this utility to good use is when I download a book in text format from Project Gutenberg. I start festival, close my eyes, relax and follow the narration.

Festival - A Few More Examples

Festival can be put to use in other ways too. For example, you can use it in batch process mode without any user interaction.

If festival is started with out passing any command line parameters, you are dropped into a shell where you can make festival read out what ever text you type on the command line. For instance, check the following examples:

$ festival festival> (SayText "Greetings from")

You can ask Festival to read a text file for you.

festival> (tts "myfile.txt")

Pros & Cons of Festival

  • Available for Free under an open source license.
  • The quality of the voice and the pronunciations are very good. 
  • Supports 3 languages - English, Spanish, and Welsh.
  • When it encounters a word not in its vocabulary, it tends to spell the word rather than pronounce it. 
  • At present, it works only on text files. So if you intend to read a PDF document using festival, it won't work. 
Other than such minor hiccups, it is a very usable piece of software.

Festival is a very good text to speech synthesizer (converter). And it is available at an unbeatable price (Free).


Anonymous said...

This is a nice utility. Thanks for explaining it on your blog.
Does it have a GUI front end or something ?
Washington DC

Anonymous said...

Thanks for another good article. I did install it but have not tried it till today.
I have HEARD this artical (copied as .txt) now and probably i will be using it regularly.

superstoned said...

i know of a nice GUI frontend ;-)

KDE. konqueror supports it, kwrite (so most kde apps that allow text input), and Koffice 1.5 (just entered feature freeze, so it'll be out soon) will support it, too. kttsd (kde text to speech deamon) is an easy to use fronted, with the just mentioned integration in most kde applications.

Anonymous said...

I tried it in Ubuntu Linux. But I had to first kill the esd daemon before festival will work.

Specifically, I had to do a
$ killall esd

I wonder if any body has encountered this in Ubuntu ?

Anonymous said...

There is a plugin available for Gaim that interfaces with festival. It allows for instant messages to be spoken by festival so you can hear it thru your speakers.

New York

Ron said...

Festival is great, but the one feature that is most important is not mentioned... text2wave. Using text2wave (part of Festival) you can read in a text file, output to .wav and pass it through lame or oggenc. This way one can pause, rewind, and take the audio with you. This does take up some resources, so it's best to split up the files into chapters (not more than 300 lines). Contact me at coathanger3 at netscape d0t net for two perl scripts, one to split the file, one to do a batch encoding. You may also want to run dos2unix against the book file before you split it up when using *nix.

Anonymous said...

Re: Anonymous 10:05PM

Ubuntu has problems with esd more generally. For instance, to get sound out of most flash animations, one has to killall esd. And of course, to get sound working properly again for the general system, esd has to be restarted. What I want to know is if this kind of problem is encountered, in this or other forms, in different distros.

Anonymous said...

@ anonymous 11:57 PM
I have been using Fedora core 2 and it does not have this problem. Fedora doesn't use Esd in my knowledge. It uses Alsa direct.

MaBu said...

A nice frontend is also perlbox, which can recognise your voice, and do commands, and speak back with festival.

Anonymous said...

One of the best voice for Festival is cmu_us_slt_arctic_hts which can be found here. More about this on

Harry said...

@anonymous (1st comment)
If you are using KDE 3.5 (I am not sure if it is there in older versions of KDE), then open konquorer and navigate to the menu Tools > Speak Text

And you will be able to configure festival to read the web page to you. It uses kttsd.

I personally feel that the main problem in such a software is the quality of the voice file.

Anonymous said...

Although Festival advertises Welsh support, the voice that would allow this does not seem to be generally available, so it is a bit misleading.

Anonymous said...

so cool man ! thanks

Anonymous said...

For festival to actually be useful as a book reader it needs a frontend that handles things like pause and resume, navigation (eg. re-read the last paragraph) and especially bookmarking. I found the lack of bookmarking a real nuisance when reading ebooks until I realized that Opera handles that with html formatted texts.

A festival book reader frontend would, for example, feed a paragraph at a time to festival and keep track of the location of this paragraph in the full text to permit navigation and bookmarking.

This sounds like a good project for someone who is a better coder than I am.

Ren said...

For those who are using Ubuntu - I'm using Ubuntu 5.10 and have been using the companion project to Festival called FreeTTS - it's a Java-based utility which can use the Festival voices. Related to FreeTTS (and also sponsored by CMU) is Festvox. I use FreeTTS without having to kill esd.

DarrenR114 AT yahoo dot com

Anonymous said...

I use Ubuntu 5.10. I have no issues with audio at all- play music, watch movies, flash,and even festival.

grupotux said...

I also use Ubuntu 5.10; tried festival from the command line and noticed that it does not recognize accented vowels (á, é, í, ó, ú, ü).
These are essential for correct pronunciation (and intended meaning) in Spanish. Strings containing accented vowels are spelled out while the accented character is merely skipped. Is there a way around this?

Anonymous said...

On the KDE desktop, I place an ICON with this action:

dcop klipper klipper getClipboardContents | fmt | festival --tts

Then I simply highlight text with the mouse and click the icon. The highlighted text is read to me. Very cool.

Anonymous said...

Neat, but I couldn't figure out how to download a higher quality voice and start using it.

On Windoze I had AT&T's Natural Voices (with ReadPlease) read books to me. It was great, but the higher quality voices make a big difference.

vinay said...

Most programs can be configured to use ESD. For programs that can't use ESD natively, you have two options (besides killing the esd daemon, of course)

1. Prefix the command you're running with "esddsp ". For example,
$ esddsp festival

This will intercept open() calls that try to access /dev/dsp and route those through esd.

2. Configure esd to release the dsp device after some period of inactivity with the -as option. For example if you pass esd "-as 5", it will release /dev/dsp after 5 seconds of inactivity so that any other program can access it directly. You can set this behavior by default in /etc/esound/esd.conf

Anonymous said...

Great tip about esd!
edit /etc/esound/esd.conf
turn on auto_spawn=1

Anonymous said...

this is great and i'm gonna do a project where by i want Festival to support Xhosa as well,i would like to know more about Festival,how it operates and help me to this project

Anonymous said...

I wrote this little script to read long clipboard texts relatively smoothly without slowing down.

xclip -o |fmt --width=2000 | while read LINE; do
sleep .5

Then I just create a link to that script from my toolbar and voila I have a more generic text reader.

Anonymous said...

Contrary to this article, you can use Festival with PDF files! The "less" command allows you to browse a PDF file, so you can simply pipe its output to festival on the command line:

less myfile.pdf | festival --tts

This will speak the text in myfile.pdf. Similarly, you could pipe the output of a program like 'Antiword' to read Word documents.

danboid said...

As has already mentioned , you can read PDFs with the command

less myfile.pdf | festival --tts

you can then pause by doing a CTRL-Z and restart by typing 'bg' or 'fg' (depending on if you want the process to resume in the background or foreground.

jj said...

I have installed "Fala" a Graphical User Interface frontend in Ubuntu Gutsy 7.10
A simple software that speaks a text. You can type the text or appoint a file. Fala is just a frontend to festival. It's designed for GNOME, but if you have gtk, pyhton and festival you are able to run it.
Available at sourceforgeDOTnet site. it is quite simple and useful.

Tim Rayner said...

Hi. I'm guessing this is scriptable but I also wondered if there's any possibilty of 'teaching' it new words. Way back in the days of the BBC Micro there was a text-to-speech program that allowed you to enter a word using a phonics code and to bind the phonics to a particular spelling (as long as it hadn't been defined already). If this were possible somehow in festival it would clear up quite a few problems. The BBC may have been behind the C64 for graphics but for programmability and expandability it was years ahead of its time (in fact they almost released a version after the BBC Master which had a built in Modem but that was when they started having financial trouble and released them without the modem as normal BBC Masters - our school had some of that model, it didn't have a modem built in but all you had to do was plug the modem in and it was ready to visit the BBSes - unlike other BBCs which needed a lot more configuration).

ravinder said...

can anybody suggest me how can i integrate festival to a new application...i.e i want to read an entre file just by one click on the file

Go there...

Fedora Linux text to speech
fedora linux text to speech - Google Search
Festival - A Text to Speech synthesis software in Linux | All about Linux
ERROR: The requested URL could not be retrieved
speech to text application fore -
Adventures switching from Windows learning and using Fedora Linux, lessons and tips
fedora linux text to speech pdf - Google Search
Enable festival Linux (text-to-speech-system) to read/speak PDF and DOC files (Speech PDF and DOC in Festival Script) | Walking in Light with Christ - Faith, Computing, Diary
The Jovie Handbook
Orca - GNOME Live!
Emacspeak User's Guide
Gnus Newsreader Homepage
jovie text to speech - Google Search
AMR Codec Libraries for GNU-Linux
CMU Sphinx - Speech Recognition Toolkit
GpsDrive - a free car (bike, ship, plane) navigation system
Festvox: Home
Speex: a free codec for free speech


No comments: