HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Introduction

Festival is a Text-To-Speech synthesis system developed at the University of Edinburgh. It can be used with several different voices, which are the models and data it uses to convert typed text into audible speech.

This HOWTO is meant to be a centralized collection of information about how to install the currently available voices for the Festival TTS. While sections of this HOWTO may apply to installing voices for other languages, it is primarily concerned with the English language voices.

The layout of this HOWTO is as follows:

Installing the standard Festvox diphone voices

Installing the enhanced MBROLA voices

Installing the enhanced CMU Arctic voices

Installing the enhanced Nitech HTS voices

Testing voices and choosing a default voice

Installing Festival 1.96 from source

Before we get started, make sure all of the preliminary packages are installed on your system with the following command:

These are the voices that are supplied by the Festvox project, which is run by the Carnegie Mellon University speech group. See the voice demo page (kal, ked, don and rab are the voices of interest). Of all of the voices we are concerned with, these take up the smallest size on disk, and are the only voices currently in the Ubuntu package tree. All of the other voices have to be installed manually. However, these are also the poorest quality voices and currently, on my computer, they cause festival to segfault (though I have used them successfully with other set-ups in the past). YMMV.

Some of the voices have 8k and 16k versions. This is the output frequency of the audio synthesis. The 16k versions have higher quality output and sound better. The four English voices are:

To find all the available festvox voices, execute the following command:

Code:

apt-cache search festvox-*

Installing the voices

Once you've decided on the voices to install, just install them as you would any other apt package. For example, this command will install all of the English voices using the higher quality 16k voices:

These voices are provided by the MBROLA project, run by the TCTS Lab of the Faculté Polytechnique de Mons in Belgium. They offer several voices, in a variety of languages, which sound much better than the Festvox diphone voices. The database of voices can be viewed at the project's download page. See the voice demo page (the us1, us2 and us3 are the voices of interest). To use the MBROLA voices we need three parts: (1.) the mbrola binary program that parses a tokenstream the festival program feeds it and returns audio data back to festival, (2.) the MBROLA voices, and (3.) the Festvox wrappers to let the festival program use the voices. This may sound scary, but it's really very easy to do.

Downloading the voices, binary and wrappers

We will download everything we need for the English voices into a temporary directory (total download size is approximately twenty megs):

Since the MBROLA project has kindly provided us with a binary deb, we can skip the step of building the binary from souce and just use dpkg to install it:

Code:

sudo dpkg -i mbrola3.0.1h_i386.deb

If you're paranoid about installing a deb from a third-party like the MBROLA project, you can grab the binary in a zip file from their download page and install it manually. There doesn't appear to be any source package released to the public, so if you're extremely paranoid, you may just want to avoid using the MBROLA voices altogether. I've personally never had a problem using the binary either from the zip or the deb.

If all went well, you now have a set of working MBROLA voices installed. See the section below on how to test that the voices are working properly.

Installing the enhanced CMU Arctic voices

These voices were developed by the Language Technologies Institute at Carnegie Mellon University. They sound much better than both the diphone and the MBROLA voices. See the information page and voice demo page (the *_arctic_cg are the voices of interest). The drawback is that each voice takes over a hundred megs on disk, and with six English voices to choose from, that can take up a lot of bandwidth to download and depending on how much disk space you have to work with, six-hundred plus megs of space might be a bit much for voice data. However, the HTS voices discussed in the next section may in fact provide equal or better quality synthesis, and are only less than %2 of the size.

Downloading the voices

We will download everything we need for the English voices into a temporary directory (total download size is approximately six-hundred megs — you might want to go brew some coffee or something, lots of it...we might be here a while):

Note: You can add the option "--limit-rate" to wget to set a maximum transfer speed (e.g., "wget -c --limit-rate=60K ..." to limit the download rate to 60KB/s).

Unpacking the voices

Due to the size of the archives, this will probably take a few minutes as well (Maybe get a slice of cake this time? Also, note than tar is run non-verbosely so we don't have seven-million lines flooding the terminal):

Note: We could just use symlinks, but then the list of installed voices (see section below on testing voices) would show entries for the actual directories and the symlinks, though only the symlinks would work properly.

Tidy up

Lastly, we can remove the temporary directory:

Code:

cd ../
rm -rf cmu_tmp/

If all went well, you now have a set of working CMU Arctic voices installed. See the section below on how to test that the voices are working properly.

Installing the enhanced Nitech HTS voices

Note: Unfortunately, these voices require at least Festival 1.95, but only 1.4 is available on Ubuntu prior to Hardy (8.04). This means that if you want to use these voices on any prior release (Gutsy, Feisty...), you need to compile Festival from source. This is relatively easy to do, and a section at the bottom of this HOWTO will guide you through the process. Don't waste your time trying to install these voices on Festival versions less that 1.95, they just won't work.

These voices are produced by the HTS working group hosted at the Nagoya Institute of Technology. They have produced excellent quality voices which take up very little disk space. In terms of quality and size, probably the best (non-commercial) English voices availible for Festival. See the voice demo page (the *_arctic_hts are the voices of interest). Highly recommended. The voices are available on their download page.

Downloading the voices

We will download everything we need for the English voices into a temporary directory (total download size is approximately ten megs):

If all went well, you now have a set of working Nitech HTS voices installed. See the section below on how to test that the voices are working properly.

Testing voices and choosing a default voice

Now that you have some voices to play with, you may want to try out different voices to suite your taste, or just to make sure things are working properly. To get a list of all the voices that are installed, you can simply look at the directories under /usr/share/festival/voices:

To select a voice, add the prefix "voice_" to the voice name, and surround it by parentheses:

Code:

festival> (voice_us2_mbrola)

Then you can test it using (SayText "The text") to speak a single line of text, or (tts "somefile.txt" nil) to process an entire file. You can also hear a short introduction about Festival with (intro).

By default, festival tries to synthesize speech to /dev/dsp using OSS. To make it work with ESD, PulseAudio or ALSA you have two options. The first is to use a wrapper to call festival, and the second is to make festival internally try to use one of them output. The advantage to the first method is that you can use the esd, pluseaudio or the alsa wrapper at any time, without having to edit the config file. The advantage of the second method is that you don't have to remember to call the wrapper—directly running festival works.

The available wrappers I know of are: the aoss wrapper program from the alsa-oss package, the padsp wrapper from pulseaudio-utils, and the esddsp wrapper from esound-clients — but caveat emptor — there is a bug (#214465) in the esddsp script right now (see this post for a quick-fix).

This is a drop-in /etc/festival.scm file. It covers all of the options mentioned about selecting a default voice and using ESD or ALSA for audio output. The ";;" are comment specifiers, so to use any of the options simply uncomment them by removing the ";;" in from of them and adding it to whatever you want to deactivate. It doesn't matter whether you have two different options uncommented at the same time (e.g., two different default_voice options), Festival will simply use whichever one is defined last in the file, however it may be a little bit slower to start up in such a case and it's better to just uncomment the one you want to use.

Note: If you have any errors that stop the build process, please report them here so I can update the HOWTO. Even if it's something trivial like a broken path, and you fix it yourself, others may not know how to fix it.

The HTS voices above require at lest Festival 1.95. Here we will go through the steps necessary to build and install Festival 1.96. This method was tested on the Dapper 6.06.1 VMplayer appliance using VirtualBox, so it should work on all Ubuntu releases. We will build a backport using official Ubuntu sources, so you don't need to remove any existing festival installation — apt will upgrade it for you.

We firstly need some development tools, libraries and headers. Use the following command to install the build requirements:

Now we can build Festival, but first we should add a patch for HTS voices (patch derived from Nitech hts.scm file included in their voices). This step is optional, but recommended, as it can improve the synthesis in some circumstances. Save the following file to festival-1.96~beta/debian/patches/lib_hts.scm.diff:

Note: This file needs to preserve formatting and tab characters! If you get an error about patching failing in the patch command below, try downloading the file from here (right-click save-as) and re-running the patch command. Alternately, you could grab the hts.scm file from a Nitech HTS voice (see section above) and replace the festival-1.96~beta/lib/hts.scm file with it, and skip the patch step.

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Thanks for the post. Definately made it easy installing the other voices.

Any reason to do your configuration in /etc/festival.scm vs ~/.festivalrc ?
I currently have alsa and my default configured in ~/.festivalrc and was wondering if I'm missing any options that could be set in the other location?

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Originally Posted by datarez

Thanks for the post. Definately made it easy installing the other voices.

Any reason to do your configuration in /etc/festival.scm vs ~/.festivalrc ?
I currently have alsa and my default configured in ~/.festivalrc and was wondering if I'm missing any options that could be set in the other location?

No problem.

The possible advantage to having your configuration in /etc/festival.scm versus having it in ~/.festivalrc is that /etc/festival.scm applies to all users, so if you have more than one user account on your computer and festival is used by multiple people, you can prevent duplicating a user config for each user and just put everything in /etc/festival.scm. Or you could put the sound configuration stuff in /etc/festival.scm and let each user select a default voice through ~/.festivalrc.

In terms of being able to set more options and such, I don't think there is any practical difference between using the global or local config files -- they are both loaded in the exact same way at the end of /usr/share/festival/init.scm (lines 138 and 146 respectively).

[People] are usually satisfied with bad argument only when their convictions rest on other grounds. (John Oman, Grace and Personality [New York: Macmillan, 1925], p. 38).

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

PS. In case anyone is interested, I'm writing a very loose front-end to festival/speech-dispatcher that can load and speak text files. This is VERY, very beta, and it comes with no support or promise that it will work (at all! for any reason!). But, in case you are interested, here you go:

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Thanks for this excellent post, it made my life a hell of a lot easier
Still got some questions, i would like to install a female voice package, i have so far only found male voices... don't they think that there are men who give their workstations female names and would like to give it a female voice?
Second question is: is there a german voice package as well? i've seen finnish, french, english but no german, i will really appreciate it if you lead me in the right direction.
Thanks a lot again.

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Yup, MonkeeSage. I had an older version "1.4.2" which I installed from apt-get , from Kubuntu feisty. I have the latest tar.gz packages from festiva'ls website, http://festvox.org/. I need to compile them. Do you know any good how to compile it, I know the INSTALL documents decribes everything, I have problems compiling the "speech tools".

Re: HOWTO: Make festival TTS use better voices (MBROLA / CMU / HTS)

Originally Posted by Cyberponcho

Thanks for this excellent post, it made my life a hell of a lot easier
Still got some questions, i would like to install a female voice package, i have so far only found male voices... don't they think that there are men who give their workstations female names and would like to give it a female voice?
Second question is: is there a german voice package as well? i've seen finnish, french, english but no german, i will really appreciate it if you lead me in the right direction.
Thanks a lot again.

Well, it depends on which voices you're using, there are female voices in the CMU and HTS voices (see their information page links in the HOWTO for which voices, I believe that the *_stl_* voice is female and there is another one or maybe two IIRC).

As for German, I believe the MBROLA page has a German voice, see the link from the HOWTO. Installing it should be just like installing the English MBROLA voices. Let me know if you need more help.

Originally Posted by Debuggern

Yup, MonkeeSage. I had an older version "1.4.2" which I installed from apt-get , from Kubuntu feisty. I have the latest tar.gz packages from festiva'ls website, http://festvox.org/. I need to compile them. Do you know any good how to compile it, I know the INSTALL documents decribes everything, I have problems compiling the "speech tools".

[. . .]

Thanks again for the how to!

Cheers!

I totally forgot to check what versions shipped with stable Ubuntu!

There's no backports for festival 1.96. I'll add a section to the HOWTO for compiling from source.

[People] are usually satisfied with bad argument only when their convictions rest on other grounds. (John Oman, Grace and Personality [New York: Macmillan, 1925], p. 38).