[Freeswitch-users] Speech Phrases

Michael Collins msc at freeswitch.org
Fri Feb 24 01:50:43 MSK 2012


On Thu, Feb 23, 2012 at 2:24 PM, Avi Marcus <avi at avimarcus.net> wrote:

> The usual method is to create phrases for everything you want.
> http://wiki.freeswitch.org/wiki/Speech_Phrase_Management with the
> "play-file" function.
>
> But if you frequently have things SAY is great for - numbers and spelling
> out words - then you can modify as MC said.
>
> -Avi
>
>
Thanks Avi, that's what I was getting at. You use the "say" app to let FS
do the work of how to pronounce something, e.g.:

<action application="say" data="en number pronounced 1234"/>
Caller hears "one thousand, two hundred, thirty-four"

<action application="say" data="en number iterated 1234"/>
Caller hears "one two three four"

You don't need the say app to do what you are trying to do. You can use
just the playback app, with or without phrase macros:

<action application="playback" data="/path/to/cool_bdf_sound.wav"/>

or

<action application="playback" data="phrase:my_cool_phrase:arg1:arg2"/>

Then you need a phrase defined. I use conf/lang/en/ivr/custom.xml for my
own phrases. E.g.:

<include>
  <macro name="my_cool_phrase">
    <input pattern="(.*?):(.*?)">
      <match>
        <action function="play-file" data="$1.wav"/>
        <action function="sleep" data="500"/>
        <action function="play-file" data="$1.wav"/>
      </match>
      <nomatch>
        <action function="play-file" data="/some/other/file.wav"/>
      </nomatch>
    </input>
  </macro>
</include>

I hope that makes sense. See pages 115-120 in the bridge book for info on
phrase macros and see pages 98,99 for info on the say application.

-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120223/544225eb/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list