The main options are espeak, Gnuspeech, spd-say, MBROLA, PicoTTS and the festvox project which festival and flite are part of. While I found espeak to be the simplest system to use, festival produced the best results when used with the right voices. This post shall outline the various ways festival can be used and the steps required to achieve good results.
Use festival’s interactive mode:
Run commands from file:
Use festival’s batch mode:
Use festival’s batch mode to run file:
Pipe text into festival’s tts mode:
Pipe text to festival’s tts mode from Python with subprocess:
Use Python wrapper of festival’s C++ API:
Festival also has a C, C++ and a client-server API. See API.
voice_cmu_us_slt_arctic_hts voice (used above) can be installed easily and isn’t bad but
the Nitech HTS voices are better. HTS stands for hidden-markov-model-based speech synthesis system and Nitech is the Nagoya Institute of Technology.
The voices were not available on the original site at the time of writing this post thus I uploaded them to a GitHub repository.
To set a voice as default voice edit the
/etc/festival.scm file and add the following line:
Note: The Nitech voices are not compatible with festival versions greater than 2.1 which is from 2010. The default festival version on Ubuntu 20.04 is 2.5.
Flite is a small, fast and more portable (albeit less customizable) speech synthesis engine for festival voices.
Install it with
sudo apt install flite. Download more voices:
The downside is, you can’t use voices from festival with flite directly. Instead you will need to convert them manually which requires time and programming knowledge. See Converting FestVox Voices.
Personally, I would stick to festival unless the speed and small size of flite are actually required.
The festival manual mentions a simple way of using festival from emacs. See Emacs interface.
There is also an ubuntu package called
eflite which is an emacspeak server based on flite.
Since the Nitech voices don’t work with newer festival versions you will have to settle for
cmu_us_slt_arctic_hts voice. If you don’t mind going commercial,
using AWS Polly is likely a better choice.