[Freeswitch-users] Interrupting "speak"
Alex
alex at thewinelake.com
Wed Jun 20 12:32:16 MSD 2012
Having got to grips with phrases, I can now see that there is a cheating
way to do this, which maybe should be put in the wiki?
Essentially, the idea is to have file
<freeswitch>/conf/lang/en/simple/simplesay.xml:
<include>
<macro name="say">
<input pattern="(.*)">
<match>
<action function="execute" data="sleep(1000)"/>
<action function="speak-text" data="$1"/>
</match>
</input>
</macro>
Modify <freeswitch>/conf/lang/en/en.xml to include:
<X-PRE-PROCESS cmd="include" data="simple/simplesay.xml"/>
If you don't use cepstral, edit the first line to be:
<language name="en" say-module="en"
sound-prefix="$${sounds_dir}/en/us/callie" tts-engine="flite"
tts-voice="kal">
Then in a lua script, you can do something like this:
whatToSay = "Hello World, I love FreeSwitch"
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*",
"phrase:say:"..whatToSay, "", "\\d+")
By the way, is there a fix for Kal talking like a chipmunk?
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list