Different application allow to have Text To Speech conversion (TTS):


To let your PC speak emerge festival

rc-update add festival default lets it start automatically.

Festival is a package from the center of speech technology research from the University of Edinburgh http://www.cstr.ed.ac.uk/. Festival is a standalone packet direct accessing the sound device. The configuration of festival is in /etc/festival and user specific configuration can be put in ~/.festivalrc.

Therefore under KDE having Alsa the following two lines have to be added to /etc/festival/siteinit.scm to use the command aplay to output the voice:

(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)

other wise you get an

"ESD: error writing - Bad file descriptor"


Note the user has to be in the speech group: gpasswd -a <user> speech

To test festival:

echo "This is your Computer running Gentoo Linux" | festival –tts

or go to the example directory

cd /usr/share/doc/festival-1.95_beta-r4/examples/

and type


Festival runs also in the console having a textual user interface. Type festival and at the prompt (SayText “Good evening”) to leave type (quit).

The voices are in /usr/share/festival/voices the line

(set! voice_default 'voice_us1_mbrola)

in ~/.festivalrc sets the voice for a user and in /etc/festival/siteinit.scm globally.


Mrola is an other speech synthesizer packet, that does not support on its own text to speech but can be controlled via festival. It supports more languages that festival.

First use ufed to set the mbrola use flag, since this lets you change the voice later. Then do something as emerge --update --deep --newuse world to have the packets mbrola updated.

Speech device

To make it Linux like emerge speechd that creates /dev/speech when started (e.g by rc-update add speechd default).

The speech demon allows more straight forward commands as:

echo "Hello" > /dev/speech

It connects to festival via a server port.

killall festival

festival –server

Now you get a window where the festival reports

Restart the speech damon

/etc/init.d/speechd restart

if you get an error as

client(4) Mon Jan 7 23:03:31 2008 : rejected from local not in access list

Open file:


and add the following line

(set! server_access_list '("[^.]+" "" "
      localhost.*" "192.168.*" "<name of your computer>"))


/etc/init.d/speechd restart

and if you get

client(3) Tue Jan 8 22:56:02 2008 : accepted from localhost

Everything should work

KDE speech tools

ksayit and kttsd are the kde tools tha can be emerged. Kttsd is the deamon of kttsmgr that allows you easily to configure the speech.

Speech to mp3

Festival comes with an script text2wave that could be used however on a kde environment it will fail. Instead of the hassle to fix it there is an easier methode. In kttsd you can simply click keep audio files and select where you want to have them. Then open a text file with kttsd and play it. Afterwards you might compress the wav files with audiacity to mp3.

Linurs Hosttech startpage