SOLVED SVOX Pico TTS for Asterisk

steven

Guru
Joined
Jun 11, 2013
Messages
24
Reaction score
11
Hey all,

With the recent demise of Google TTS and the rather unpleasant mannerism of Flite, I set out in search of another free text-to-speech solution for Asterisk. I found Pico TTS, which is SVOX's open source distribution of their offline text-to-speech engine. Some might already be familiar with this engine, as it is used as the default text-to-speech engine in the Android Open Source Project.

In order to integrate Pico TTS into Asterisk, I modified Lefteris Zafiris' Google TTS AGI script to run the appropriate commands to generate output from Pico TTS. As a result, the implementation is exactly the same, and you can easily download the script and do a find/replace in your dialplan to switch over to Pico TTS.

To install Pico TTS, simply follow the instructions below as root:

Ubuntu/Debian:
Code:
 apt-get install libttspico-utils
CentOS/Scientific Linux/Fedora/RHEL:
Code:
 wget https://raw.githubusercontent.com/stevenmirabito/asterisk-picotts/master/picotts-install.sh -O - | sh
Raspberry Pi:
Follow the instructions here: http://rpihome.blogspot.com/2015/02/installing-pico-tts.html

Once Pico TTS is installed, download the AGI script and set the proper permissions:
Code:
cd /var/lib/asterisk/agi-bin
wget https://raw.githubusercontent.com/stevenmirabito/asterisk-picotts/master/picotts.agi
chown asterisk:asterisk picotts.agi
chmod 700 picotts.agi
I just put this together last night, so I can't guarantee that it works flawlessly, but I have it running on my development box and it seems to be working great. If you have any feedback or run across any issues, please feel free to file an issue on GitHub.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
@steven Seem to be some issues with the CentOS platform. This code change fixed the install issues, but there must be a missing dependency. Nothing but silence.
Code:
arch1=`uname -m`

if [ "$arch1" = "x86_64" ]
then
    arch="amd64"
else
    arch="i386"
fi
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
This works great!

I tested on an RPi2.

To get it to work, I had to either remove the "en" language parameter used in the README examples, or change it to "en-US" or "en-GB" (didn't try anything else).

We need the asterisk app modules to make it a full replacement for flite. It's not quite as good as Google or Cepstral, but it at least gets free TTS out of the 1980's quality of flite and into the 21st century.

If I only had the time....
 

Luis RAMIREZ

New Member
Joined
Dec 21, 2015
Messages
1
Reaction score
0
The links to download the .deb files in the installer are not working, I found the files ( here https://packages.debian.org/jessie/ ) and replace the urls but the problem seems to be that this installer is for Debian since it tries to install .deb packages. I am looking for a way to install .deb packages on CentOS.

The error I got is that is not a valid tar file.

Does anyone know if it is better than Festival?
 

omunni

Guru
Joined
Feb 12, 2010
Messages
27
Reaction score
7
CentOS......The download errors are due to the script being unable to properly detect the architecture. I modified the script by deleting the "# Check architecture" section and directly inputting the variable i386 (in my case) where needed. Afterwards, everything worked as expected. The TTS installed properly after the changes made and worked fine.
Do not forget to use proper language parameter "en-US" as stated a couple of post above ! or you will get nothing but silence.
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
PIONEERS: Here's a quick & dirty turnkey installer FOR Incredible PBX (CentOS/SL only) to convert GoogleTTS to @steven SVOX PicoTTS creation:
Code:
cd /
wget http://incrediblepbx.com/picotts.tar.gz
tar zxvf picotts.tar.gz
cd /root
./picotts-install.sh
sed -i 's|en)|en-US)|' /etc/asterisk/extensions_custom.conf
sed -i 's|googletts|picotts|' /etc/asterisk/extensions_custom.conf
asterisk -rx "dialplan reload"
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
For Debian, Ubuntu, but not Raspberry Pi Raspbian, here's the modified Incredible PBX installer:
Code:
cd /
wget http://incrediblepbx.com/picotts.tar.gz
tar zxvf picotts.tar.gz
cd /root
rm -f picotts-install.sh
apt-get install -y libttspico-utils
sed -i 's|en)|en-US)|' /etc/asterisk/extensions_custom.conf
sed -i 's|googletts|picotts|' /etc/asterisk/extensions_custom.conf
asterisk -rx "dialplan reload"

For Raspberry Pi Raspbian, here's the modified Incredible PBX installer:
Code:
cd /
wget http://incrediblepbx.com/picotts-raspi.tar.gz
tar zxvf picotts-raspi.tar.gz
rm -f picotts-raspi.tar.gz
cd /root
echo "Installing Pico TTS..."
./picotts-install.sh
 
Last edited:

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
Google TTS gal sounded clearer, louder and more life like. Perkier too. Bummer. At least the picotts should work more reliably.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Works just fine, and I agree, Google TTS was perkier. It seems to me that there should be a library of available voices to select from, even if it's a small charge. Anyone know?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Google TTS gal sounded clearer, louder and more life like. Perkier too. Bummer. At least the picotts should work more reliably.

Think of the Google TTS gal is that girl in high school that only dated high school quarterbacks. If you happened to be one, good for you. Otherwise, stop drooling. :drool5:
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
Think of the Google TTS gal is that girl in high school that only dated high school quarterbacks. :drool5:

But I WAS dating that girl and her father forbade her from seeing me anymore without any cause or notice. You even set us up on our first date. Now my most viable "alternative" is her cousin from the less aesthetically pleasing side of the family. Sheesh :(
 
Last edited:

davea

New Member
Joined
Jan 21, 2010
Messages
13
Reaction score
7
Hi all. I installed PicoTTS and works fine even in Italian. I noticed a couple of things:
1) picotts.agi at speed 1 is as fast as googletss.agi at speed 1,5
2) picospeaker utility outputs a file that doesn't need normalization; googletts-cli used to output a file at a very lower volume.

On an old distro (CentOS 5.8 - Asterisk 1.6) I had to modify install script because tar utility was unable to manage xz.
Here's the modified picotts-install.sh script, if someone faced the same problem:


Code:
#!/bin/bash

# Installer for SVOX Pico TTS on non-Debian platforms
# Author: Steven Mirabito <[email protected]>

# Check architechure
if [ $(uname -m) == 'x86_64' ]; then
    pkgarch="amd64"
else
    pkgarch="i386"
fi

# Get work directories set up
cd /usr/src
mkdir libttspico

# Download and extract Pico TTS libraries
wget http://mirrors.kernel.org/ubuntu/pool/multiverse/s/svox/libttspico0_1.0%2bgit20130326-3_${pkgarch}.deb
ar x libttspico0_1.0+git20130326-3_${pkgarch}.deb data.tar.xz
unxz data.tar.xz
tar -xf data.tar -C "libttspico"
rm -f data.tar

# Dowload and extract Pico TTS voice data
wget http://mirrors.kernel.org/ubuntu/pool/multiverse/s/svox/libttspico-data_1.0%2bgit20130326-3_all.deb
ar x libttspico-data_1.0+git20130326-3_all.deb data.tar.xz
unxz data.tar.xz
tar -xf data.tar -C "libttspico"
rm -f data.tar

# Download and extract Pico TTS utilities (pico2wave)
wget http://mirrors.kernel.org/ubuntu/pool/multiverse/s/svox/libttspico-utils_1.0%2bgit20130326-3_${pkgarch}.deb
ar x libttspico-utils_1.0+git20130326-3_${pkgarch}.deb data.tar.xz
unxz data.tar.xz
tar -xf data.tar -C "libttspico"
rm -f data.tar

# Delete packages
rm -f libttspico*.deb

# Move files into place
mv "libttspico/usr/lib/"*-linux-gnu/* "libttspico/usr/lib"
rmdir "libttspico/usr/lib/"*-linux-gnu
mv libttspico/usr/bin/* /usr/bin/
mv libttspico/usr/lib/* /usr/lib/
mv libttspico/usr/share/pico /usr/share/
mv libttspico/usr/share/doc/* /usr/share/doc/
mv libttspico/usr/share/man/man1/* /usr/share/man/man1/

# Install picospeaker
cd /usr/src
git clone git://github.com/the-kyle/picospeaker.git picospeaker
install -D -m755 picospeaker/picospeaker /usr/bin/picospeaker
rm -rf picospeaker

Dave
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Effective 1/9/2016, new Incredible PBX ISO and OVF installs are preconfigured with Pico TTS support. Coming soon to the rest of the fleet. :boat:
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Effective 1/10/2016 at 3:30 pm EST, new Incredible PBX 13 installs for Ubuntu and RasPi2 are preconfigured with Pico TTS support.

NOTE: For those upgrading existing servers, be aware of major changes in the Raspberry Pi procedure because of missing packages in Raspbian (documented above). We have downloaded and compiled the pieces from source to save everyone some time when installing using our script. To review how we got there, see this tutorial.
 

krakastan

Guru
Joined
Feb 20, 2008
Messages
135
Reaction score
22
Installed Pico as per NV article (thank you as ever!) and 951 etc function ok. However
having issues with the sample rate output from

Code:
pico2wave --wave /var/lib/asterisk/sounds/tts/FileName.wav -l en-GB "Text here."

which seems to be 16000, and is not liked when used as an announcement which I believe prefers 8000?

Code:
    -- Executing [s@app-announcement-3:4] NoOp("SIP/100-00000001", "Playing announcement TestGB") in new stack
    -- Executing [s@app-announcement-3:5] Playback("SIP/100-00000001", "tts/FileNamegb,noanswer") in new stack
[2016-01-16 17:25:52] WARNING[3116][C-00000001]: format_wav.c:115 check_header_fmt: Unexpected frequency mismatch 16000 (expecting 8000)
[2016-01-16 17:25:52] WARNING[3116][C-00000001]: file.c:472 fn_wrapper: Unable to open format wav

Have looked around but no cure can see! Can you advise......

thanks

---------------------------------
Incredible PBX/Fax 13-12.2 at RentPBX
Gotcha-Free Asterisk 13.5 Incredible GUI 12.0.39
 

Members online

Forum statistics

Threads
25,825
Messages
167,839
Members
19,250
Latest member
mark-curtis
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top