[asterisk-users] Cepstral and Asterisk

John Millican jmillican at sentinelcommunications.com
Wed Aug 16 18:10:16 MST 2006


On Wednesday August 16 2006 7:01 pm, Don wrote:
> Has anyone used Cepstral for text to speech before? I am testing the demo
> and it seems to take about 20 seconds for the speech to start... On a
> 3.4Ghz 2GB machine...
>
> Thanks,
> Don
Don,
I have been using Cepstral for about a year now and it has worked very well. 
It starts speaking almost immediately. You definitely know it is a computer 
voice but thats okay for my application. 
The following is swift.agi that I found on voip-info.org (I cant remember the 
author or I would credit him here, my apologies.)  The last line documents 
how to use.
##############################
#!/bin/sh 

#Assign the value sent from the exten=> line to "$text" so it can be used 
below 
text=`echo $*` 

#Set $stdin to something 
stdin="0" 

while [ "$stdin" != "" ] 
 do 
   read stdin 
    if [ "$stdin" != "" ] 
     then 
      stdin2=`echo $stdin | sed -e 's/: /=/' -e 's/"//g' -e 's/$/"/' -e 
's/=/="/'` 
      eval `echo $stdin2` 
     fi 
 done 

calleridnum=`echo $agi_callerid | cut -f2 -d\< | cut -f1 -d\>` 
calleridname=`echo $agi_callerid | cut -f1 -d\< ` 

/opt/swift/bin/swift -o /tmp/$agi_uniqueid.wav -p 
audio/channels=1,audio/sampling-rate=8000 " $text " 

#Now, tell asterisk to play that file 
echo "stream file /tmp/$agi_uniqueid #" 

#Read the reply from asterisk to our command 
read stream 

#Clean up our mess and delete that file 
rm /tmp/$agi_uniqueid.wav 

exit 0 

#####  exten=> s,1,agi(swift.agi|This is some text\, which needs to be 
converted to speech.) 
##########################################

I have used this (on a very low call volume obviously) on as low end a machine 
as PII 400 with 512 meg ram.
Hope this helps
-- 
John Millican
Senior Partner
Director of Technology
Sentinel Communications
PO Box 9
Wentworth, NH 03282
(603) 764-9163




More information about the asterisk-users mailing list