How to Install Google TTS in Freepbx

Written by admin on March 13, 2015. Posted in Applications and addons, Asterisk

Many times you need a free voice in Freepbx since voice offered by Flite engine is horrible. The other offered by Swift is good but not cheap. Google TTS offers a free but averagely good conversion on text to speech. Problem is you get bits and pieces of information to such an extenst that a novice would not be able to fit these bits together to come up with a solution.

This article seeks to show step by step how to  install Google TTS on a freepbx machine. (PLEASE NOTE the Freepbx installation referred here is on Centos 6   64bit

After you have installed your freepbx you need to login as root on ssh and do the following

1. Install google tts

yum -y install perl perl-libwww-perl sox cpan
rpm -Uhv
yum -y install mpg123
PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install Bundle::LWP"
PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install CGI::Util"
mv googletts.agi /var/lib/asterisk/agi-bin/
chmod 755 /var/lib/asterisk/agi-bin/googletts.agi

cd /tmp
git clone git://
cd asterisk-goo*
cd cli
mv /usr/local/sbin/

2. Configure propolys-tts.agi

nano /var/lib/asterisk/agi-bin/propolys-tts.agi



case 'swift':
exec($enginebin." -p audio/channels=1,audio/sampling-rate=8000 -o $wavefile -f $textfile");

and below add

case 'googleTTS':
exec($enginebin." -l de -f $textfile -r 8000 -o $wavefile");

when done the file should  be able to look like this at the portion you edited


case 'swift':
exec($enginebin." -p audio/channels=1,audio/sampling-rate=8000 -o $wavefile -f $textfile");
case 'googleTTS':
exec($enginebin." -l de -f $textfile -r 8000 -o $wavefile");

You are done configuring google TTS but before you start using it, Go to freepbx GUI and look under Settings for Text to speech Engines

add engine and name it whatever you want. If you dont have this module make sure you install it using module admin.


For the engine path use


Now you can select text to speech under applications in Freepbx you will now be able to see google tts on the dropdown along with flite.


I hope this tutorial helps