Text to Speech on ubuntu

  • 0
A text to speech function can be provided with a program called Festival. Used for development and research it is capable of producing clearly understandable speech from text.
sudo apt-get install festival

Install a voice. You have a choice of some voices on the repositories.
festvox-rablpc8k -British English male 8khz.
festvox-rablpc16k -British English male 16khz.
festvox-don -British English male.
festvox-te-nsk -Telugu male.
festvox-suopuhe-mv -Finnish male
festvox-suopuhe-lj -Finnish female.
festvox-mr-nsk -Marathi male.
festvox-kdlpc8k -American English male 8khz.
festvox-kdlpc16k -American English male 16khz.
festvox-kallpc8k -American English male 8khz.
festvox-kallpc16k -American English male 16khz.
festvox-hi-nsk -Hindi male speaker.

Choose one and install with:
sudo apt-get install chosenpackagefromabove

To make it say something I make a text file with the text I want spoken and run the following (change the file location):
cat file.txt | festival --tts

Or you can run Festival in a terminal and use (SayText "something"). Keep the brackets. For example:
festival> (SayText "Testing Testing")

To use it with pidgin so that IM's are read out aloud install the pidgin-festival package:
sudo apt-get install pidgin-festival

To activate it open Pidgins plug-ins (in tools or Ctrl + U). Find Festival. Tick it and restart.


Click configure to see the options. Select a voice for the plug-in if you have more than one installed. Maximum message lengths is useful. You don't want someone annoying to instant message you a message the size of a book and have it all read out with 5 chats going. Also announcing events its neat if your out the room "Fred is online".

Changing voices can be done by running festival. Type festival in a terminal to start the festival prompt. Use this command (voice_NAMEOFVOICE) changing the voice name to which ever voice you want like festival> (voice_don_diphone). To find voice names of the packages you have installed look in /usr/share/festival/voices/.

If your seriously wanting to use Festival daily you may like to have more realistic voices checkout ubuntuforums.org/showthread.php?t=677277 for instructions. For an online demo, source and other information see cstr.ed.ac.uk/projects/festival.

No comments:

Post a Comment