We'll go through 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 of professionally recorded prompts.
Festival is a 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
After installing Festival, we would like 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:
as reference for your installation,type
To verify that Festival() dialplan application is running, type following command on Asterisk command line interface.
Hope this tutorial helped someone.
You may also check on the following related tutorials:
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 of professionally recorded prompts.
How to install Asterisk PBX 13.x on CentOS 7 step by step guide
Festival is a 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
sudo yum install festivalHow to install Festival on Ubuntu
sudo apt-get install festivalConfiguring Festival for use with Asterisk
After installing Festival, we would like 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:
vim /usr/share/festival/lib/festival.scmAdd the the following text just above the last line; (provide 'festival):
(define (tts_textasterisk string mode)Save changes and restart the Festival server
(let ((wholeutt (utt.synth (eval (list 'Utterance 'Text string)))))
(utt.wave.resample wholeutt 8000)
(utt.wave.rescale wholeutt 5)
(utt.send.wave.client wholeutt)))
sudo festival_server 2>&1 > /dev/null &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 reference for your installation,type
cd /usr/src/asterisk-13/asterisk-13.7.0/Make sure it's checked.See screen shot below
make menuselect
make installAsterisk has to be configured to connect to Festival server on festival.conf file. There is a sample configuration file located in Asterisk source directory .We'll copy it to /etc/asterisk/ directory then edit.
cd /usr/src/asterisk-13/asterisk-13.7.0/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 host parameter. All other configuration parameters will be left to default.
cp configs/samples/festival.conf.sample /etc/asterisk/festival.conf
vim /etc/asterisk/festival.confChange where necessary.
To verify that Festival() dialplan application is running, type following command on Asterisk command line interface.
core show application festivalIf you don't get any output, first load the app_festival.so module:
module load app_festival.soYou can check file availability in /usr/lib/asterisk/modules.If you used my tutorial to install Asterisk, you may have realised that i compiled asterisk with libdir being --libdir=/usr/lib64. For this case, the module will be on
module show app_festival.so
ls -lh /usr/lib64/asterisk/modules/app_festival.soelse:
ls -lh /usr/lib/asterisk/modules/app_festival.soFrom here. you can create simple dialplan like one below for testing:
exten => 110,1,Verbose(2,Performing Festival test)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.
same => n,Answer()
same => n,System(echo "We are now doing Festival Test after successful installation" | /usr/bin/text2wave -scale 1.5 -F 8000 -o /tmp/test.wav)
same => n,Playback(/tmp/test)
same => n,System(rm -f /tmp/test.wav)
same => n,Hangup()
Hope this tutorial helped someone.
You may also check on the following related tutorials:




