festival Text-To-Speech

By | 21 Feb 2009

Simultaneous playback

The festival text-to-speech synthesizer seems to use normal ALSA playback instead of PulseAudio. This leads to it failing when there’s already something playing. E.g. if you’re listening to music with Rhythmbox, festival fails with this message:

Linux: can't open /dev/dspCode language: HTTP (http)

To make it use PulseAudio, we can re-route the audio through the pacat utility as proposed on this bugreport. Just add these few lines to your /usr/share/festival/init.scm:

(Parameter.set 'Audio_Command "pacat --channels=1 --rate=$SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Format 'raw)Code language: PHP (php)

Note: I had to use raw as the required format since the snd from the bugreport gave me loud noise instead of speech. raw works fine.

Announcing system errors

On fedorabook.com I found this little script which will read every new line from /var/log/messages:

#!/bin/bash
tail -0f /var/log/messages | sed "s/^[^:]*:[^:]*:[^:]*: //" | while read LINE
#tail -0f /var/log/syslog | sed "s/^[^:]*:[^:]*:[^:]*: //" | while read LINE
#tail -0f /var/log/auth.log | sed "s/^[^:]*:[^:]*:[^:]*: //" | while read LINE
#tail -0f /var/log/user.log | sed "s/^[^:]*:[^:]*:[^:]*: //" | while read LINE
do
    echo $LINE
    echo $LINE | festival --tts
    sleep 0.75
doneCode language: PHP (php)

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.