CallXML 3.0 Development GuideHome  |  Frameset Home


<say>  element

The new CallXML3.0 <say> element replaces the <text> element used in CallXML2.0, and allows the developer to output a TTS string to the caller. The TTS voice will default to the Speechify2.0 'English female' persona, if left unspecified in the 'voice' attribute.


usage
<say choices="(grammar value)" id="(element id)" test="CDATA" value-is="STRING" value-is-not="STRING" voice="(TTS Voice)">


attributes
choicesData Type: (grammar value)Default: Optional
The 'choices' attribute defines a list of comma delimited voice recognition utterances that will be active for the container element. Alternatively,  the attribute can contain a choice followed parantheses containing different words which equate to that choice. Note that both dtmf grammars, and spoken word grammar utterances can be defined; digit values always indicate dtmf input, whereas spelled 'literals' for numbers imply that the grammar must be spoken:


<say choices="1, one">press, or say one</say>


One can also define multiple matches to return the same value to the application by specifying the values in the following format:

<ContainerElementName choices="ReturnValue (subchoice1, subchoice2)">

As such, either of the 'subchoice' utterances will be interpreted as 'ReturnValue'. To illustrate in greater detail:

<say choices="Beatles (john, paul, ringo, george),
              Rolling Stones (mick, keith, charlie, ron)"
>
      Say the name of a Beatle, or a Rolling Stone.
</say>


Lastly, developers can also make use of a builtin number grammar for capturing a string of digit values by specifying [x DIGITS], where 'x' is the length of the string that you wish to collect:

<block choices="[5 DIGITS]">

This can also be modified to accept input of varying lengths by specifying [x-y DIGITS], where 'x' and 'y' are the minimum and maximum values for the length of the string being collected:

<block choices="[5-8 DIGITS]">

idData Type: (element id)Default: none - attribute is optional
The new 'id' attribute in CallXML3.0 is applicable to all container and action elements. Specifying this attribute allows yet another level of control and event handling when events occur and are caught by the <on> element. When an event occurs, the handler will first check the event, and then verify that the handler has a handler specific to the 'id' attribute to execute. This allows the developer to plan a specific course of action for events based on where in the application that they occur.
testData Type: CDATADefault: Optional
The 'test' attribute is a new supplement to the CallXML markup that permits the developer to execute the contents of a container element, or action element, based on whether or not the specified condition is met. If the defined condition is met, then the code contained within the element is then executed. If the condition is not met, then the application resumes execution with the next sequential container container element in the document.
value-isData Type: STRINGDefault: none - attribute is optional
Another new attribute, 'value-is', grants the developer with the ability to perform conditional logic upon container elements, or action elements for the first time within the CallXML markup. The value specified in the 'value-is' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is' equate to 'true', then the element specified will execute. If the value equates to 'false' then the element will be skipped during document execution.
value-is-notData Type: STRINGDefault: none - attribute is optional
Another new attribute, 'value-is-not', grants the developer with the ability to perform conditional logic upon container elements, or action elements, for the first time within the CallXML markup. The value specified in the 'value-is-not' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is-not' equate to 'false', then the element specified will execute. If the value equates to 'true' then the element will be skipped during document execution.
voiceData Type: (TTS Voice)Default: none - attribute is optional
The voice attribute defines the Text-to-Speech voice that should be used for what is enclosed within that particular <text> element. This allows the developer a way to override the default voice genders/styles on a prompt by prompt basis. The currently supported voices for the CallXML2.0 platform are:

  • English-Female2 (default)
  • English-Male2
  • French-Female1
  • Spanish-Female1



code samples
<3.0 say-choices-test>
<callxml version="3.0">

  <do label="B_1">
  <!-- this will play, as '1' is equal to '1' -->
    <say choices="bo, luke, coy, vance" test="1=1">
      who is your favorite duke boy from the dukes of hazzard?
    </say>

    <wait value="8s" choices="bo, luke, coy, vance"/>

    <on event="choice:bo">
    <playaudio value="dixie.wav"/>
    </on>   
   
  </do>

  <do label="B_2"> 
  <!-- this will not play, as '7' is not equal to '9' -->
    <say choices="issac, captain stubing, gopher" test="7=9">
      who is your favorite charater from the love boat?
    </say>
  </do> 

  <do label="B_3">
  <!-- this will not play, as 'kotter' is not equal to 'benson' -->
    <say choices="barbarino, arnold, mister kotter"
            test="&apos;kotter&apos; = &apos;benson&apos;">

      who is your favorite character from welcome back kotter?
    </say>
  </do> 


  <do label="B_4"> 
  <!-- this will play, as 'ichi' is not equal to 'sick monkey' -->
    <say choices="kakihara, ichi, jijii"
            test="&apos;ichi&apos; != &apos;sick monkey&apos;">

      who is your favorite character from ichi the killer?
    </say>

    <wait value="8s" choices="kakihara, ichi, jijii"/>


    <on event="choice:kakihara">
    <log>you need help, my friend.</log>
    </on> 

  </do> 

</callxml>


<3.0 say-id>
<callxml version="3.0">


  <do label="B_1">

    <say id="S1" choices="please shoot me">
      At any point, you may say 'please shoot me' to end the misery.
    </say>

    <say id="S2" choices="please shoot me">
Rush Limbaugh was born in Cape Girardeau, Missouri January 12,
        1951. He became interested in radio as a young man and went to
        work for a local Top 40 station while still in high school.
    </say>

    <say id="S3" choices="please shoot me">
He graduated from Central High School in 1969. 
He attended Southeast Missouri State University before criss
        crossing the country holding several different jobs.
    </say>

    <say id="S4" choices="please shoot me">
He landed as a radio talk-show host at KFBK in Sacramento,
        California in 1985.
He is still afraid of the dark to this day, and sleeps with a
        teddy bear named 'chug chug' to ward off the monsters.
    </say>

    <say id="S5" choices="please shoot me">
    In 1988 Rush took his radio show to New York where it went national.
    The rest is history.
    </say>



    <on event="choice:please shoot me" target="S1">
    <say> you chose to stop your own suffering at S1 </say>
    </on>


    <on event="choice:please shoot me" target="S2">
    <say> you chose to stop your own suffering at S2 </say>
    </on>


    <on event="choice:please shoot me" target="S3">
    <say> you chose to stop your own suffering at S3 </say>
    </on>


    <on event="choice:please shoot me" target="S4">
    <say> you chose to stop your own suffering at S4 </say>
    </on>

  </do> 

</callxml>



   

<3.0 say-valueis>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">

  <do label="B_1" value="dirtyjoke">

<!-- this will be played, as 'dirtyjoke' is equal to 'dirtyjoke' -->
    <say value-is="dirtyjoke">
      So, a Priest, a Rabbi, and a Scientologist walk into a bar.
    </say>

    <wait value="5s"/>

<!-- this will be skipped, as 'cleanjoke' is not equal to 'dirtyjoke' -->
    <say value-is="cleanjoke">
      (!!! Censored !!!)
    </say>

<!-- this will be skipped, as 'dirtyjoke' is equal to 'dirtyjoke' -->
    <say value-is-not="dirtyjoke">
      (!!! Censored !!!)
    </say>

<!-- this will be played, as 'cleanjoke' is not equal to 'dirtyjoke' -->
    <say value-is-not="cleanjoke">
      So then the Priest says:
    "No sir, that is what we call the French Embassy."
    </say>

    <playaudio value="daffyla.wav"/>

  </do>

</callxml>


< 3.0 say-choices: DIGITS grammar>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">

      <say choices="[4 DIGITS]">
          Enter your 4 digit pin.
      </say>
      <!-- Note that the choices attribute is not needed in the wait if you barge in during the initial prompt -->
      <wait value="5s" choices="[4 DIGITS]"/>

      <on event="choice">
        <prompt value="The pin you entered, was"/>
        <playnumber format="digits" value="$session.lastchoice;"/>
      </on>

</callxml>




additional links
none


  ANNOTATIONS: EXISTING POSTS
jpw
1/23/2008 3:04 AM (EST)
maybe add one quick example of a choices= that handles maybe 3 options, each of which has voice and dtmf options?
jpw
1/23/2008 3:13 AM (EST)
also, how do you specify the pound key. if I use choices="pressedpound( #), ... it does not recognize the pound key, eg, never throws the choice:pressedpound event

voxeojeff
1/23/2008 9:23 AM (EST)
Jpw,

If you're wanting to navigate further into the document based on DTMF-#, then you'll want to use <on event="termdigit:#"> in your code.  This is actually documented in the <on> element: http://docs.voxeo.com/callxml/3.0/on.htm.

Regards,

Jeff
jpw
4/13/2008 9:33 PM (EDT)
...what about the (completely undocumented) voice attribute -- what are the options?

VoxeoBrian
4/13/2008 9:57 PM (EDT)
Hello,

There are only 2 TTS voice available in Prophecy and they are a male and female english voice.  You can get to this when specifying "English-Female4" "English-Male4"

Of course, you can utilize a full range of MRCP complaint TTS engines, that can be integrated with Prophecy in both our shared and hosted environments.

Regards,

Brian

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site