Home » Incredible PBX » CentOS/SL Platform » gTTS: The Ultimate (free) Text-to-Speech Engine for Asterisk

The Most Versatile VoIP Provider: FREE PORTING

gTTS: The Ultimate (free) Text-to-Speech Engine for Asterisk


Telephony is all about person-to-person communications. But much of what we do in the real world involves gathering information from non-human sources. These include books, magazines, and newspapers as well as sources that provide real-time news, weather, sports scores, stock quotes, inventory and personnel data, reservation systems, and historical data from countless other sources. No modern phone system would be complete without providing an interface to this data and for that you’ll need a text-to-speech engine (TTS). We previously have covered some free voice synthesis offerings including Google TTS, FLITE and Festival, and PicoTTS as well as commercial products like Amazon’s Polly TTS and IBM TTS.

With our special tip of the hat to Dick Ollett (@dicko), we are delighted to present what may very well be the best, free TTS offering out there, gTTS. To simplify the install on Incredible PBX platforms, we’ve developed scripts for Rocky8, Debian/Raspbian 10, and Ubuntu 20.04 that install gTTS and also update the Weather Forecasts (947) and News Headlines (951) applications.

Begin by logging into your server as root. On the Rocky 8 platform, here are the steps:

cd /var/lib/asterisk/agi-bin
dnf install python39 -y
pip3 install --upgrade pip
dnf install jq -y
pip3 install gTTS
wget http://incrediblepbx.com/gtts.tar.gz
tar zxvf gtts.tar.gz
rm -f gtts.tar.gz
./install-gtts-dialplan.sh

On the Debian, Raspbian, and Ubuntu platforms, issue the following commands:

cd /var/lib/asterisk/agi-bin
apt-get update
apt-get -y install jq libsox-fmt-all
apt-get -y install python3-pip
pip install --upgrade pip
pip3 install --upgrade pip
ln -s /usr/bin/pip3 /usr/bin/pip
pip install gTTS
wget http://incrediblepbx.com/gtts.tar.gz
tar zxvf gtts.tar.gz
rm -f gtts.tar.gz
./install-gtts-dialplan.sh

For those wishing to develop your own TTS applications for Asterisk, carefully review the dialplan code for News Headlines (951) in /etc/asterisk/extensions_custom.conf and the accompanying AGI script in /var/lib/asterisk/agi-bin: nv-news-yahoo.php. Enjoy!

Originally published: Monday, August 15, 2022



Need help with Asterisk? Visit the VoIP-info Forum.


 

Special Thanks to Our Generous Sponsors


FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.

BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.

The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.

VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
 

Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
 




3 Comments

  1. On Debian,

    pip install –upgrade pip # failed to work the first time

    pip3 install –upgrade pip # this worked well enough, then I reran the command that preceded it, and everything is working.

    I dialed 951 and noticed the difference right away.

    Is it possible to generate .mp3 or .wav files to use as IVRs with gTTS?

    [WM: Certainly possible to generate .wav files. See the gtts.php file in /var/lib/asterisk/agi-bin. An even better solution for one-time payment of $27 is SpeechVID with 304 commercial-quality voices in 44 languages. ]

Comments are closed.