Chris D
Posts: 89
Joined: Tue Sep 20, 2016 11:27 am

Flite - how & where to install voices

Mon Oct 03, 2016 1:33 pm

Hello all you Pi people,

I have been working with the Pi for the last month, I am making good progress with programming in Python(3) and all around find it a fun experience.

I am adding TTS to the program I am working on and would like to use Flite, however, the voice that came with the package is not so good. I would like to use one of the other "standard" voices but those were not installed with the package. I know where to get the voice file from, however, I can't figure how to install it or where to install it (it being the voice).

Can someone guide me on that process?

Thanks

Chris D

garrettm
Posts: 1
Joined: Thu Feb 23, 2017 3:51 pm

Re: Flite - how & where to install voices

Thu Feb 23, 2017 7:46 pm

Hey so I know this is a bit old, but did you ever find out how to install voices for flite? I would also like to add voices to the default list, but can find much about how to go about it.

sisk
Posts: 32
Joined: Thu Jan 12, 2012 5:04 pm

Re: Flite - how & where to install voices

Fri May 19, 2017 4:00 am

So, necroposting here, but I'm half answering the question at least.

First let me tell you how flite is SUPPOSED to work. You're supposed to be able to point it at a file for the voice, like so:

Code: Select all

flite -voice /home/pi/cmu_us_eey.flitevox tts-test.txt
However on the Pi flite flat refuses to read the voice file and instead defaults to kal when you try the code above. This leads me to believe that there's something wrong with the binary in the Raspian repository.

I compiled it from the upstream source myself as a fix, but alas there's something wrong with my binary as well. It fails to find a sound output. It wants /dev/dsp, which isn't there on a Pi, and doesn't even try to find any other sound devices.

However I am able to generate a wave file in whatever voice I wish using my compiled binary, so as a workaround to not being able to play directly from flite I've taken to having it generate a wave file in /tmp (to minimize wear on the SD card) and then playing that file with aplay. It's a bit kludgy but it works. Eventually, when I've got the time and energy, I'll track down why it's not finding the sound device and recompile it without that flaw.

If you want to try to compile it yourself, it's not difficult. I'm not sure what dependencies it has, but I apparently have them all installed already. Here's how to do it:

Code: Select all

sudo apt-get install build-essential
wget http://www.festvox.org/flite/packed/flite-2.0/flite-2.0.0-release.tar.bz2
tar -xvf flite-2.0.0-release.tar.bz2
cd flite-2.0.0-release
./configure
*There's a good chance that right here you're going to run into needed dependencies. Read the output carefully, install any missing libraries, run ./configure again, repeat as necessary. *
make
Opitonally you could the run sudo make install to install it, but the default in the source code installs it to /usr/local/bin instead of /usr/bin, which means theer are extra steps to take after doing that. That being the case, you might as well just copy ./bin/flite to /usr/bin.

Anyway, I hope that helps someone out. Sometime when it's not already 11pm I'll revisit this and compile it a little better and maybe even publish a binary.

UPDATE:

As promised I went back and figured out what was wrong with my compiled binary. To fix it, you just need to specify the 'with-audio=alsa' parameter of the configure script, so compiling it looks like this:

Code: Select all

wget http://www.festvox.org/flite/packed/flite-2.0/flite-2.0.0-release.tar.bz2
tar -xvf flite-2.0.0-release.tar.bz2
cd flite-2.0.0-release
./configure --with-audio=alsa --with-vox=awb
make
make install
You can replace the awb with any of the published flite voices, which negates the need to point it at voice files. You can, of course, leave that part off and keep pointing it at the voice files, but as long as you're compiling it anyway why not bake the one you're going to use in? In my opinion awb and rms are the highest quality ones available. The first is based on Alan Black's voice, complete with Scottish accent (perfect for my project) and the second sounds like Richard Stallman.

Return to “Beginners”