3

I currently have festival 2.4 installed and configured.

Heres what I'm doing:

I first use ./bin/festival to get into the festival prompt.
Then do (SayText "test") which should have the tts speak the word test

Now when I have festival 2.1 installed using apt-get from the repository this command works as expected, it says "test"
However when running from manually-built festival 2.4 it reports no error, but also no sound. I have used set parameter commands and tried every audio method, also tried the set parameter command with Audio_Device and tried many of the devices from /dev/ and /dev/snd/ on my system to no avail.

Note that oss-compat is installed, I saw that listed as a solution somewhere and it was already installed from when I built cmu sphinx a while back.

My question is what is apt-get doing that I'm not. I've been at this for about 12 hours now so any ideas are welcome.

Update: I have used strace to monitor the calls festival is making to the system in an attempt to find out whats causing this, heres what I've come up with:

My system has multiple audio deivces connected to it, the integrated audio on the motherboard which is fried, the hdmi outputs of the nvidia card, and a usb audio device I'm using for the time being. ls /dev/ shows three audio devices, as expected /dev/audio, /dev/audio2, and /dev/audio3. Setting festival to use the first two with (Parameter.set 'Audio_Device "/dev/audio") did the same thing as before, no error but also no sound. However when using the third device /dev/audio3 I get Linux: can't open /dev/audio3 upon further investigation with aforementioned strace I discovered this:

open("/dev/audio3", O_WRONLY) = -1 EBUSY (Device or resource busy)

I searched around a bit and the only mentions of this error I can find are for specialized cases for whatever the person in question was doing.

2 Answers2

4

You simply need to configure Pulseaudio. Add these lines to the end of your ~/.festivalrc file, or to /usr/share/festival/festival.scm:

(Parameter.set 'Audio_Required_Format 'aiff)
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • Yes I did this after you commented earlier, works like a charm! – HalfLife420 Mar 06 '17 at 00:14
  • In case you have multiple sound sinks (like an HDMI output) and fail to get sound, just add --device=0 or --device=1 to the last command. ex: (Parameter.set 'Audio_Command "paplay --device=0 $FILE --client-name=Festival --stream-name=Speech") Use "pacmd list-sinks" to identify the appropriate sink. – KIAaze Apr 14 '18 at 21:06
  • It just makes a weird hissing sound now, although it does come from the proper output. – Haggra Nov 25 '20 at 19:27
0

I found the solution to the problem. Armed with the information from strace It was only a matter of tracking down what was blocking my access to my audio devices.

fuser -fv /dev/snd/* /dev/dsp* /dev/audio* will effectively show you anything accessing any audio device on your system. It showed that pulseaudio was accessing /dev/snd/control****, not audio3 but still worth a try. Then I ran pulseaudio -k to kill pulseaudio. After that I can hear festival.

  • 1
    The proper solution is to configure Festival to use pulseaudio instead https://wiki.archlinux.org/index.php/Festival – Nikolay Shmyrev Mar 05 '17 at 21:16
  • @NikolayShmyrev If only you had told me that many hours ago ha ha. Now it works much better and I don't have to close other applications to make it work. Thank you very much Nikolay! – HalfLife420 Mar 05 '17 at 22:17