We’ll go through the process of installing and Configuring Festival Speech-to-text utility developed by University of Edinburgh, UK community.
Text-to-speech conversion is very crucial when working with Asterisk Pbx or any Media servers used for routing calls. Text-to-speech utilities are used to convert strings of words into audio that can be played to the callers using the system. Text-to-speech is not a replacement for professionally recorded prompts.
Festival is free to use text-to-speech utility that works on all Linux systems. It is not recommended for production use because its sound quality is not clear enough, but used very often for development and testing purposes. For production use, you can have a look at Cepstral.
How to install Festival on CentOS and RHEL
How to install Festival on Ubuntu
Configuring Festival for use with Asterisk
After installing Festival, we would like to configure it to allow use with Asterisk PBX. To do this, we just have to edit festival.scm file located in /usr/share/festival/ directory. Open the file with any text editor you have.I will use vim:
Add the the following text just above the last line; (provide ‘festival):
Save changes and restart the Festival server
Go to your Asterisk source directory and verify that the app_festival application is selected under Aplications heading. If not, use make menuselect command to install Festival() diaplan apllication.If you had used my tutorial at
as a reference for your installation, type
Make sure it’s checked.See screen shot below
Asterisk has to be configured to connect to Festival server on festival.conf file. There is a sample configuration file located in the Asterisk source directory.W e’ll copy it to /etc/asterisk/ directory then edit.
The default configuration is enough to connect to Festival server provided both are running on a local machine. If Festival service is running on a remote device, we’ll change the host parameter. All other configuration parameters will be left to default.
Change where necessary.
To verify that Festival() dialplan application is running, type following command on Asterisk command line interface.
If you don’t get any output, first load the app_festival.so module:
You can check file availability in /usr/lib/asterisk/modules.If you used my tutorial to install Asterisk, you may have realized that I compiled asterisk with libdir being –libdir=/usr/lib64. For this case, the module will be on
From here. you can create simple dialplan like one below for testing:
If you dial extension number 110, it should automatically record test.wav audio file from the string “We are now doing Festival Test after successful installation” and play it back to you.
Hope this tutorial helped someone.
You may also check on the following related tutorials: