1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-09-20 06:33:24 +01:00
wiki.mbirth.de/know-how/software/linux/_posts/2009-02-22-festival.md

55 lines
1.8 KiB
Markdown
Raw Normal View History

2015-04-13 20:20:11 +01:00
---
created: 2009-02-22 00:53:11 +0100
2022-01-23 17:14:59 +00:00
layout: redirect
layout_old: default
redirect_to: https://blog.mbirth.de/archives/2009/02/22/festival-text-to-speech.html
2015-04-13 20:20:11 +01:00
tags:
2022-01-23 17:14:59 +00:00
- know-how
- software
- linux
- sound
title: festival Text-To-Speech
toc: false
updated: 2009-02-22 00:54:41 +0100
2015-04-13 20:20:11 +01:00
---
2022-01-23 17:14:59 +00:00
2015-04-13 20:20:11 +01:00
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/dsp
To make it use PulseAudio, we can re-route the audio through the `pacat` utility as proposed on [this bugreport](https://bugzilla.redhat.com/show_bug.cgi?id=467531).
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)
~~~
**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](http://dailypackage.fedorabook.com/index.php?/archives/42-Productive-Monday-Festival-Speech) I
found this little script which will read every new line from `/var/log/messages`:
{% highlight bash %}
#!/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
done
2022-01-23 17:14:59 +00:00
{% endhighlight %}