Home » Posts tagged 'cepstral' (Page 2)
Tag Archives: cepstral
Allison’s Text-to-Speech Trifecta: Cepstral, Asterisk 1.4 or 1.6, and FreePBX 2.4
If you've longed for a text-to-speech Asterisk® toolkit that sounds just like the default Allison prompts that ship with Asterisk 1.4, then today is your lucky day. We're going to walk you through installing Cepstral with Asterisk 1.4 or 1.6 and FreePBX 2.4. The icing on the cake is a new Cepstral voice that sounds just like the twin sister of Asterisk's Allison. And guess what? Just like the two Darryl's on the Bob Newhart Show, the twin sister's name is Allison, too. What a coincidence! Well, not really. Allison is actually the first TTS voice created using Cepstral's new VoiceForge™ technology. For the complete history of the development of Allison's voice for Cepstral, you can read all about it here.
Update: For the latest news on Cepstral and app_swift, visit the PBX in a Flash Forums.
Next week, in Part 2, we'll build the Nerd Vittles' Stealth AutoAttendant in FreePBX to answer your incoming calls with a separate IVR to process calls when you're not around. For those new to Nerd Vittles, the Stealth AutoAttendant answers incoming calls with a message like this: "Hi. You've reached Total Telephony Solutions. Please hold a moment while we connect your call to the next available representative." Or, for home users, the message might go something like this: "Hi. You've reached the Mundy's residence. Someone will be right with you." While the greeting message is playing, you can press keys on your phone to transfer to an extension, activate DISA, or retrieve your voicemail messages. Because the options aren't advertised in the greeting, other callers won't know they're available. We'll protect the IVR options with passwords, of course. The NoAnswer or Unavailable IVR will also include options to leave a message, transfer to your cell phone, or drop into an applications AutoAttendant. The difference in the 2008 version of these AutoAttendants is that, this time around, you can customize all of the IVR announcements and options to meet your specific needs in less than a minute. And we'll design, develop, and deploy the entire solution using FreePBX's web interface and no custom code. All of this becomes possible thanks to FreePBX and Cepstral's Allison, who will be on your payroll once we get finished up with this project.
Prerequisites. To get this working won't cost you a dime. But, once you've played with it and like it (and we know you will), you'll need to spring for the $30 to license the Cepstral Allison voice for your Asterisk system. Our advice is simple. Try it first. Then you can buy it. You'll also need a robust Asterisk 1.4 platform with Linux, Apache, SendMail, PHP, and MySQL preconfigured to support text-to-speech applications. Not that we're biased or anything, but may we recommend you give PBX in a Flash a try. You'll find complete installation instructions and the free download here.
And, during the FreePBX Training Seminar in Charleston, we'll walk you through revising the Nerd Vittles weather, news, and email text-to-speech applications to take advantage of the tremendous power that Cepstral and Cepstral's Allision now bring to your Asterisk platform. See what you're missing by not attending the FreePBX Training Seminar. Don't worry!! We'll share all of the code with you anyway, but the seminar participants will get to play with it first.
Installing Cepstral. For today, we're going to walk you through installing Cepstral with the Cepstral Allison voice. But there are numerous other voices. You can check all of them out on the Cepstral demo site. Just be sure to select only the 8kHz voices which are specifically designed to support telephony applications. Once you find the voice you like, you can decipher the download link here. Be sure you choose the correct i386-Linux version for your system. You can't use the 32-bit version on a 64-bit CentOS system, e.g. the new 64-bit ISO of PBX in a Flash 1.2. But the same license key works for both the 32-bit and 64-bit versions of the same voice. Upgrades to the 5.0 Cepstral voices are available here.
CentOS 5.x 32-bit Install. For the 32-bit version of PBX in a Flash 1.1 or 1.2, log into your system as root and enter the following commands:1
cd /root
wget http://downloads.cepstral.com/cepstral/i386-linux/↩
Cepstral_Allison-8kHz_i386-linux_5.1.0.tar.gz
tar -zxvf Cepstral*
cd Cepstral_Allison-8kHz_i386-linux_5.1.0
./install.sh
CentOS 5.1 64-bit Install. For the 64-bit version of PBX in a Flash 1.2, log into your system as root and enter the following commands:
cd /root
wget http://downloads.cepstral.com/cepstral/x86-64-linux/↩
Cepstral_Allison-8kHz_x86-64-linux_5.1.0.tar.gz
tar -zxvf Cepstral*
cd Cepstral_Allison-8kHz_x86-64-linux_5.1.0
./install.sh
After you've read the license, type yes to install the voice on your system, not -yes- as the instructions imply. Don't ask how I know. Accept the default locations for the installation. When the installation completes, issue the following command:
echo /opt/swift/lib > /etc/ld.so.conf.d/cepstral.conf
ldconfig
Now plug some speakers into your PBX in a Flash system, and type: swift "Hello World." If you want to get fancy, try this one:
swift "Hello <break time='200ms' /> World"
You can read up on Cepstral's Speech Synthesis Markup Language (SSML) here. Before we continue, you need to write down the name of the installed voice. You'll need this to register the voice later and to get Asterisk set up properly to use Cepstral. Here's the command to retrieve the voice name(s) that you've installed:
ls /opt/swift/voices
Installing app-swift. There's another important piece in getting Cepstral to play nicely with Asterisk 1.4 or 1.6, apt-swift. In the words of the author, it does four things and does them well:
* Doesn't keep the caller waiting in silence while the app generates the entire TTS output to a temp file
* Doesn't unceremoniously kill off the swift engine when done, upsetting the Cepstral license server and eating a concurrency license
* Has configurable in-memory buffering of the swift output to balance memory usage vs Swift process concurrency
* Responds to user DTMF during the speech by setting a channel variable and optionally doing a goto of the extension entered
Asterisk 1.4 Install. To install apt-swift on your PBX in a Flash/Asterisk 1.4 system:
cd /usr/src
wget http://pbxinaflash.net/source/app_swift/app_swift-1.4.2.tar.gz
tar -zxvf app_swift*
rm *.gz
cd app_swift-1.4.2
make
make install
Asterisk 1.6 Install. If you're using the newer versions of PBX in a Flash with Asterisk 1.6, you will need Darren Session's 1.6-compatible version of app-swift:
cd /usr/src
wget http://pbxinaflash.net/source/app_swift/app_swift-1.6.2.tar.gz
tar -zxvf app_swift-1.6*
rm *.gz
cd app_swift-1.6.2
make
make install
cp swift.conf.sample /etc/asterisk/swift.conf
chown asterisk:asterisk /etc/asterisk/swift.conf
Finally, you need to add a link in your search path for Cepstral and modify /etc/asterisk/swift.conf to tell it which voice you want to use with Asterisk and then restart Asterisk. Assuming you installed Allison-8kHz, here are the commands.
ln -s /opt/swift/bin/swift /usr/bin/swift
sed -i 's|David-8kHz|Allison-8kHz|' /etc/asterisk/swift.conf
amportal restart
Testing Cepstral in Your Dialplan. To be sure that everything is installed and working with Asterisk, issue this command:
asterisk -rx "core show application swift"
You should receive the following response:
-= Info about application 'Swift' =-
[Synopsis]
Speak text through Swift text-to-speech engine.
[Description]
Swift(text) Speaks the given text through the Swift TTS engine.
Returns -1 on hangup or 0 otherwise. User can exit by pressing any key.
If everything is working swimmingly, let's modify your dialplan a bit to give Cepstral a test run. Edit /etc/asterisk/extensions_custom.conf (nano -w filename) and search (Ctrl-W) for 1234. You should then see a string of code that looks something like this:
exten => 1234,1,Playback(demo-congrats)
exten => 1234,2,Hangup()
exten => h,1,Hangup()
Let's modify it so that it looks like this:
;exten => 1234,1,Playback(demo-congrats)
exten => 1234,1,Swift(Congratulations! You have installed Cepstral.)
exten => 1234,2,NoOp(Key pressed: ${SWIFT_DTMF})
exten => 1234,3,Swift(You pressed ${SWIFT_DTMF}. Goodbye.)
exten => 1234,4,Hangup()
exten => h,1,Hangup()
Save your changes (Ctrl-X, then Y, then Enter). And restart Asterisk: amportal restart. Now dial 1-2-3-4 from an extension on your PBX in a Flash system. Presto! Welcome to the World of Cepstral on your Asterisk 1.4 PBX. Should you have problems with the install, kindly post a message on the PBX in a Flash Forum. Enjoy!
Licensing Cepstral Voices. If you've made it this far with no hiccups, it's probably time to cough up your 30 bucks and make the nag messages disappear. (HINT: Read all of the comments, and you might save some money.) Keep in mind that it's $30 per simultaneous connection using Cepstral! If you're an application designer, you probably need to keep this in mind. It doesn't tie up your Cepstral voice very long to read a sentence. But reading a 7-day weather forecast is another matter. For the latter type application, it makes more sense to conserve your voice licenses by quickly generating a .wav file with Cepstral and then releasing the Cepstral engine. The same applies with IVR applications. Using Cepstral is the same PHP syntax as flite except you substitute the swift command, e.g. system("swift -f $inputfile -o $outputfile"). You then can play back the .wav file using other tools within Asterisk. Now go to this link to pay the piper. Be sure you select U.S. English language, Allison-8kHz voice, and Linux platform before you check out, or it's money down the drain. Write down the name, company (optional), and key that is issued once you fill in the blanks. Then it's back to your PBX in a Flash system as root and enter the following command. Note: it's two hyphens before the word reg-voice.
swift --reg-voice
Fill in the blanks with the information you wrote down, and you're all set. Dial 1-2-3-4 from a phone on your system again, and the nag message should be gone.
Your Name: John Q. Public
Company (if applicable): Acme Widgets
Voice: Allison-8kHz
License Key: xx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx
Some Recent Nerd Vittles Articles of Interest...
- Join the following line and the original line with no intervening space when you encounter the ↩ character. [↩]