VoiceXML 2.1 Development Guide Home  |  Frameset Home

  tutorial Hello World  |  TOC  |  tutorial Call Flow   

Tutorial: VoiceXML hello world with voice recognition

This tutorial is based on the things you accomplished in Tutorial 1. If you have not completed that tutorial, you'll need to go through it first.


Step 1: creating our initial VoiceXML structure


From our previous tutorial, we now recognize the following structure as a normal starting point:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
</vxml>



Step 2: our first look at making a voice recognition menu

As you might expect, utilizing voice recognition is not a trivial process; nevertheless, the establishment of a basic set of responses to prompts can be done fairly painlessly. VoiceXML requires the use of a "grammar", which we will get to in a moment, but first we need an actual menu/form so that the caller knows what to say.

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >

  <form id="MainMenu">
    <field name="SouthParkCharacter">
      Please say your favorite South Park character's name.
    </field>
  </form>



Now we wax dramatic and add the grammar. The caller has been prompted, and we need to have the mechanism to capture their input. So we still need to tell our "menu" to look at a grammar which will translate what the caller says into something our application can respond to. Let's look at a common inline GSL grammar structure:

<grammar type="text/gsl">
  <![CDATA[
    ;Match one of the enclosed terms
    [
      ;Each line is recognized as a separate term
      ;Terms are separated by a space
      kenny
      cartman
      stan
      kyle
      canadians
      chef
      wendy
      timmy
      hanky
      garrison
      pip
      ike
      mephisto
      jimbo
      tweak
      marvin

      ;Match either terrance or phillip
      ;Square brackets are the same as OR
      [terrance phillip]

      ;Parentheses require all of the enclosed terms to be matched
      (mister hat)
      (big gay al)
      (cartmans mom)
      (mister mackey)
    ]
  ]]>
</grammar>



Our grammar file can be much shorter or much longer than this, but we see above more than enough names to learn several important aspects concerning VoiceXML. First, and possibly most important, is that we declare the grammar 'type' attribute. The Prophecy browser requires this attribute in order to properly use this grammar within your VoiceXML application; failure to specify this value will result in an error. Therefore, it is a good idea to make a habit out of always declaring the <grammar type> in your VoiceXML documents. Next, notice that the names inside the brackets are what VoiceXML is attempting to match against what the caller speaks over the phone. Notice that these are all lowercase: this is not by accident. These must be lowercase, otherwise VoiceXML will interpret them as references to other grammar blocks, (or, more precisely grammar Rulenames). What does that mean? It means that "[kenny]" attempts to match speech to the word "kenny" and "[KENNY]" searches for another grammar structure entirely that is called "KENNY".

Our next point involves several of our entries that have multiple words (such as "[terrance phillip]" and "(mister hat)". Notice that some use parentheses, while others use only brackets. There is a subtle but important distinction between the two nomenclatures: if you use brackets, but multiple words, then any of the words will match; if you use parentheses, then all the words must match, in the order shown, or there is no valid match. Thus, "[terrance phillip]" matches if VoiceXML hears "terrance" or "phillip"; however, if VoiceXML's grammar entry is "(mister hat)", then it has to hear "mister hat" -- "mister" or "hat" are not enough by themselves to match.

Whew, that was a lot of description. But you can begin to see how powerful careful matching can be. Moreover, the syntax is extremely straightforward.

A brief summary of basic GSL grammar syntax




Step 4: incorporating grammar values into our application

Now that we have a menu and a grammar that is referenced by that menu, what do we do now?  Since we went to all the trouble of writing out a grammar that returned values based on what the caller said, why don't we do something with those values:

  <filled namelist="SouthParkCharacter">
    <if cond="SouthParkCharacter == 'kenny'">
    <elseif cond="SouthParkCharacter == 'cartman'"/>
    <elseif cond="SouthParkCharacter == 'stan'"/>
    <elseif cond="SouthParkCharacter == 'kyle'"/>
    <elseif cond="SouthParkCharacter == 'canadians'"/>
    <elseif cond="SouthParkCharacter == 'chef'"/>
    <elseif cond="SouthParkCharacter == 'mister hat'"/>
    <elseif cond="SouthParkCharacter == 'big gay al'"/>
    <elseif cond="SouthParkCharacter == 'wendy'"/>
    <elseif cond="SouthParkCharacter == 'timmy'"/>
    <elseif cond="SouthParkCharacter == 'hanky'"/>
    <elseif cond="SouthParkCharacter == 'garrison'"/>
    <elseif cond="SouthParkCharacter == 'cartmans mom'"/>
    <elseif cond="SouthParkCharacter == 'pip'"/>
    <elseif cond="SouthParkCharacter == 'ike'"/>
    <elseif cond="SouthParkCharacter == 'mister mackey'"/>
    <elseif cond="SouthParkCharacter == 'mephisto'"/>
    <elseif cond="SouthParkCharacter == 'jimbo'"/>
    <elseif cond="SouthParkCharacter == 'marvin'"/>
    <else/>
      <!-- This will never be visited -->
      <reprompt />
    </if>
  </filled>


For anyone who has coded before, this section should look familiar enough.  The <filled> tag means that our <field> has been filled with a recognized value (retrieved from our grammar).  Then we have a long series of <if> and <elseif> statements as we determine which value actually came back from our grammar.  Notice that we use a double equal sign (like many languages use) to determine if our <field> variable (called "SouthParkCharacter") is equal to a specific value.  This value must be scripted in single quotes (i.e., ' ').  That is all there is to it.  Of course, we still are not responding to the caller, but that is simple enough to rectify.  Let's associate some text-to-speech with each of our possible conditions/matches:


  <filled namelist="SouthParkCharacter">
    <if cond="SouthParkCharacter == 'kenny'">
      <prompt>Kenny has more lives than a cat.</prompt>
    <elseif cond="SouthParkCharacter == 'cartman'"/>
      <prompt>Cartman is not fat.  He is big boned.</prompt>
    <elseif cond="SouthParkCharacter == 'stan'"/>
      <prompt>Stan likes Wendy.</prompt>
    <elseif cond="SouthParkCharacter == 'kyle'"/>
      <prompt>Kyle has a gay dog.</prompt>
    <elseif cond="SouthParkCharacter == 'canadians'"/>
      <prompt>Canada.  What is that aboot?</prompt>
    <elseif cond="SouthParkCharacter == 'chef'"/>
      <prompt>Chef is the coolest man in South Park.</prompt>
    <elseif cond="SouthParkCharacter == 'mister hat'"/>
      <prompt>Mister Hat is a puppet.</prompt>
    <elseif cond="SouthParkCharacter == 'big gay al'"/>
      <prompt>Big Gay Al is gay.</prompt>
    <elseif cond="SouthParkCharacter == 'wendy'"/>
      <prompt>Wendy likes Stan.</prompt>
    <elseif cond="SouthParkCharacter == 'timmy'"/>
      <prompt>Timmmy!  Timmmy tim maugh!</prompt>
    <elseif cond="SouthParkCharacter == 'hanky'"/>
      <prompt>Mister Hanky, the Christmas poo.</prompt>
    <elseif cond="SouthParkCharacter == 'garrison'"/>
      <prompt>Mister Garrison is gay.</prompt>
    <elseif cond="SouthParkCharacter == 'cartmans mom'"/>
      <prompt>Cartman's mom loves the Denver Broncos.</prompt>
    <elseif cond="SouthParkCharacter == 'pip'"/>
      <prompt>Pip is British.</prompt>
    <elseif cond="SouthParkCharacter == 'ike'"/>
      <prompt>Ike is also Canadian.</prompt>
    <elseif cond="SouthParkCharacter == 'mistermackey'"/>
      <prompt>Mister Mackey.  Mmmmmmkay.</prompt>
    <elseif cond="SouthParkCharacter == 'mephisto'"/>
      <prompt>Mephisto enjoys experimenting on animals.</prompt>
    <elseif cond="SouthParkCharacter == 'jimbo'"/>
      <prompt>Jimbo is a redneck.</prompt>
    <elseif cond="SouthParkCharacter == 'marvin'"/>
      <prompt>Marvin is really hungry.</prompt>
    <else/>
      <prompt>
        A match has occurred, but no specific if statement
        was written for it.  Probably just a minor character
        like Tweak or Jimbo's gun-toting friend.
      </prompt>
    </if>
  </filled>


It looks like a lot of text, but really we just added one line of text-to-speech code for each match.  Text-to-speech is enabled by putting plain text between <prompt> elements.


Step 5: putting it all together

Just a couple more lines of code, we swear.

Since voice recognition is not always 100% accurate for matching, we want to add a few handlers between our <field> tags.  <noinput> and <nomatch> will handle scenarios where our caller does not follow the rules set up by our grammar.  For example:


  <noinput>
    <prompt>I did not hear anything.  Please try again.</prompt>
    <reprompt/>
  </noinput>

  <nomatch>
    <prompt>I did not recognize that character.  Please try again.</prompt>
    <reprompt/>
  </nomatch>


The <noinput> tag is fairly self-explanatory: it is triggered if the caller does not say anything.  Thus, we now have a nice little extra prompt that informs them to say something.  <reprompt> simply repeats the <field> tag from the start.  In a similar fashion as <noinput>, <nomatch> is triggered when VoiceXML hears something, but cannot successfully match it to a value in the grammar.

Our script is now complete, and the entire file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
  <form id="MainMenu">
    <field name="SouthParkCharacter">
      <!-- Since we are in a field tag, we do not need <prompt> tags surrounding the text-to-speech -->
      Please say your favorite South Park character's name.

      <!-- Define our grammar -->
      <grammar type="text/gsl">
      <![CDATA[
        ;Match one of the enclosed terms
        [
          kenny cartman stan kyle canadians chef wendy timmy
          hanky garrison pip ike mephisto jimbo tweak marvin
          [terrance phillip]
          (mister hat) (big gay al) (cartmans mom) (mister mackey)
        ]
      ]]>
      </grammar>

      <!-- The user was silent, restart the field -->
      <noinput>
        I did not hear anything.  Please try again.
        <reprompt/>
      </noinput>


      <!-- The user said something that was not defined in our grammar -->
      <nomatch>
        I did not recognize that character.  Please try again.
        <reprompt/>
      </nomatch>
    </field>

    <!-- Set the namelist attribute to the name of the corresponding field -->
    <!-- This is filled only when one of the values in the grammar is matched -->
    <!-- That value is then sent to this section -->
    <filled namelist="SouthParkCharacter">
      <!-- Check the "SouthParkCharacter" variable against each of the valid values -->
      <!--  defined in our grammar -->
      <if cond="SouthParkCharacter == 'kenny'">
        <prompt>Kenny has more lives than a cat.</prompt>
      <elseif cond="SouthParkCharacter == 'cartman'"/>
        <prompt>Cartman is not fat.  He is big boned.</prompt>
      <elseif cond="SouthParkCharacter == 'stan'"/>
        <prompt>Stan likes Wendy.</prompt>
      <elseif cond="SouthParkCharacter == 'kyle'"/>
        <prompt>Kyle has a gay dog.</prompt>
      <elseif cond="SouthParkCharacter == 'canadians'"/>
        <prompt>Canada.  What is that aboot?</prompt>
      <elseif cond="SouthParkCharacter == 'chef'"/>
        <prompt>Chef is the coolest man in South Park.</prompt>
      <elseif cond="SouthParkCharacter == 'mister hat'"/>
        <prompt>Mister Hat is a puppet.</prompt>
      <elseif cond="SouthParkCharacter == 'big gay al'"/>
        <prompt>Big Gay Al is gay.</prompt>
      <elseif cond="SouthParkCharacter == 'wendy'"/>
        <prompt>Wendy likes Stan.</prompt>
      <elseif cond="SouthParkCharacter == 'timmy'"/>
        <prompt>Timmmy!  Timmmy tim maugh!</prompt>
      <elseif cond="SouthParkCharacter == 'hanky'"/>
        <prompt>Mister Hanky, the Christmas poo.</prompt>
      <elseif cond="SouthParkCharacter == 'garrison'"/>
        <prompt>Mister Garrison is gay.</prompt>
      <elseif cond="SouthParkCharacter == 'cartmans mom'"/>
        <prompt>Cartman's mom loves the Denver Broncos.</prompt>
      <elseif cond="SouthParkCharacter == 'pip'"/>
        <prompt>Pip is British.</prompt>
      <elseif cond="SouthParkCharacter == 'ike'"/>
        <prompt>Ike is also Canadian.</prompt>
      <elseif cond="SouthParkCharacter == 'mister mackey'"/>
        <prompt>Mister Mackey.  Mmmmmmkay.</prompt>
      <elseif cond="SouthParkCharacter == 'mephisto'"/>
        <prompt>Mephisto enjoys experimenting on animals.</prompt>
      <elseif cond="SouthParkCharacter == 'jimbo'"/>
        <prompt>Jimbo is a redneck.</prompt>
      <elseif cond="SouthParkCharacter == 'marvin'"/>
        <prompt>Marvin is really hungry.</prompt>
      <else/>
        <prompt>
          A match has occurred, but no specific if statement
          was written for it.  Probably just a minor character
          like Tweak or Jimbo's gun-toting friend.
        </prompt>
      </if>
    </filled>
  </form>
</vxml>



Step 6: upload, and try it out

All that remains now is to upload your new VoiceXML application.  In keeping with our naming scheme, we might save this files as http://www.myserver.com/helloworld/helloworld2.xml

Now you can use the Voxeo Account Manager to provision a number to your simple voice recognition application and call the associated number to hear (and speak!) the results.

What we covered:



Download the Code!

  Voice Recognition Source Code


  ANNOTATIONS: EXISTING POSTS
ericj
7/27/2004 1:34 AM (EDT)
The copy of the source code contained in "Download the Code" is different from what is shown in the tutorial.  The "Download the Code" code is missing the <prompt> tag in front of each prompt listed in the if construct.

- ej
ericj
7/27/2004 2:24 AM (EDT)
The menu choices in the sample code are properly formatted in lower case (kenny cartman hanky et al).  However, the matching items in the If construct are incorrectly shown in initial caps.

<elseif cond="SouthParkCharacter == 'Hanky'"/>
        <prompt>Mister Hanky, the Christmas poo.</prompt>

should be

<elseif cond="SouthParkCharacter == 'hanky'"/>
        <prompt>Mister Hanky, the Christmas poo.</prompt>

in order to properly match the selection to the prompt.

steve.sax
7/27/2004 1:10 PM (EDT)
Eric,

Thanks for pointing out this inconsistency; I have corrected this in our internal docs, and you can expect this be reflected in our live docs within the next day or two.

Warm Regards,

Steve Sax
adrianysk
2/3/2005 12:55 AM (EST)
I have tried it but I have an error, the prompt does not finish reading "Please say your favorite South Park character's name." and it stops and starts capturing voice input from user. Say like..."Please say ........" then the recognition starts. This will give the user uncertainty what the question is all about. Why this may happen?
MattHenry
2/3/2005 1:51 AM (EST)
Hola adrian,

Theres any number of reasons this could happen, but without seeing debug logs containing the call info, I can only guess. A bad connection with static, or a noisy environment would be two likely candidates for this behavior. If you'd like to capture the debug logs, and create an account ticket with them attached, I can certainly take a look and offer my input.

~Matt
adrianysk
2/3/2005 2:07 PM (EST)
#5036

I am not sure how to capture the debug notes...as I am still new in the area. And the forum as well. However, the above is the ticket that I have created? Does that reflect anything?

Thanks Matt...
adrianysk
2/6/2005 5:37 AM (EST)
Greetings Matt,

I have already solved my problem. I added the following line to the <prompt> tag ...

    bargein="false"

<prompt bargein="false">


Then the prompt will be readed completely before the sure can continue with the recognition.

Thanks.
rrobertc
3/25/2005 9:43 AM (EST)
Why do you have [terrance phillip] inside []? The whole thing is already inside the OR[]. Also I don't see terrance or phillip in the if statments.
MattHenry
3/25/2005 11:39 AM (EST)
Hiya Robert,


Thaks for catching those typos. I'll see about correcting that just as soon as time permits.

~Matt
jlam
4/27/2006 7:45 PM (EDT)
Can someone explain to me why some tags close with the / at the front or the end of the < >

ie <repompt/> and </noimput>
MattHenry
4/27/2006 8:54 PM (EDT)


Hiya Eric,

Some XML tags dont neccessarily hold values, or attributes; therefore, they are self-closing, and have but one directive with no additional parameters. Other elements do hold user-defined values, and even attribute values that specify sub-directives to execute: At it's most basic:

<element attributename="att_value">
  element_valus
</element

Versus:

<element/>

The w3c XML, and even HTML specifications both have oodles of information on this topic, that really dive into this topic, if you are inclined to learn more.


Cheers,

~Matt
Khamyl
5/7/2006 4:08 PM (EDT)
Hallo!

What will be the value of "SouthParkCharacter" variable if I say one of [terrence fillip]? Can I assign to this element one specific valu e.g. "OneOfTerrenceAndFillip"?

Thanx
Michael.Book
5/7/2006 7:44 PM (EDT)
Hello Khamyl,

In this example, the value of 'SouthParkCharacter' would simply be the name of the character you say.  If you say "Terrance," the value will be 'terrance'.  If you say "Phillip," the value will be 'phillip'.

If you want to assign a specific value to the field name, simply use a slot value for your grammar entry.  For example, your grammar might look like this:

-------------------
<grammar scope="document" type="text/gsl">
  <![CDATA[ 
    .MYRULE
      [
        terrance {<mySlot "Terrance of the Terrance and Phillip show">}
        phillip {<mySlot "Phillip of the Terrance and Phillip show">}
      ]
  ]]>
</grammar>
-------------------

The link below is to a forum posting that has a good explanation on what values are assigned to a recognition field name, and even gives an example of how you could assign a specific slot value to a given grammar entry.  I would recommend taking a quick peak...

http://community.voxeo.com/bizblog/viewer?&bb-name=masterforum&bb-q=steelers&&bb-cid=10&bb-tid=80638#bb

I hope this helps...


Have Fun,

~ Michael
mmdoufu
8/18/2006 10:39 AM (EDT)
hey, howdy!

I really enjoyed playing with VXML. Keep up with your great work!

I just copied and pasted the South Park character and tested it, found that if I say 'big gay al' always returns

"  A match has occurred, but no specific if statement
    was written for it.  Probably just a minor character
    like Tweak or Jimbo's gun-toting friend."

I turned on the debug then realised that the grammar returns 'big gay al', not 'biggayal'. Therefore, the elseif statement should be written like

    <elseif cond="SouthParkCharacter == 'big gay al'"/>
    <prompt>Big Gay Al is gay.</prompt>

      <elseif cond="SouthParkCharacter == 'mister mackey'"/>
      <prompt>Mister Mackey.  Mmmmmmkay.</prompt>

Cheers,
ay
erik707kire
9/7/2006 7:25 AM (EDT)
I do not expect a free call to my application from Bulgaria, but what number should I use to call into my app. from there? The country code, plus the same free-phone number but without the 800???
Erik
MattHenry
9/7/2006 10:22 AM (EDT)


Hello Erik,

Might I suggest a cheaper alternative? You can always connect to your voxeo applications by using a VoIP service such as free world dialup, or skype. Alternatively, you can download a 2 port trail of our IVR platform software, and run it on your local machine:

http://www.voxeo.com/prophecy

Cheers,

~Matthew Henry
KMadhuka
11/22/2006 9:40 AM (EST)
In the above example there is no <prompt> tag before the sentence
"Please say your favorite South Park character's name"
How this will interpreted as a <prompt> to voice the sentence.

Thanks
Madhukar
VoxeoJoe
11/22/2006 11:47 AM (EST)
Hello Madhukar,

If your text is within a set of "prompt", "field", or "block" tags, it will get rendered as TTS.


Sincerely,

Joe Gallina
Voxeo Corporation
artybala
7/21/2007 1:06 AM (EDT)
I am trying to learn VoiceXML and when using the following code, the system says it has an internal error and could not locate the URL. it comes after it reads out the prompt. Can someone help me with what i am missing . Thanks.

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

<vxml version="2.0">

<form id ="firstform">

<field name = "CallerKey">

  How are you today. Please give me your name

</field>

</form>

</vxml>
voxeojeremy
7/21/2007 8:40 AM (EDT)
artybala,


You should have a grammar and filled element with this type of script.  To view an example of this, please visit our XML Grammars tutorial, located at http://docs.voxeo.com/voicexml/2.0/t_21.htm .  Please let us know if you require additional assistance.


Thank you very much!

Jeremy McCall
Voxeo Extreme Support
artybala
7/22/2007 4:43 PM (EDT)
Thanks a lot Jeremy. I added the Grammer and it works fine now. what should i do if my grammer is in a database table? If i am storing employee names in a database table, how do i use that as grammer with out having to create and XML or the gsl type one.
Thanks for your help.
- artybala
voxeojeff
7/23/2007 11:37 AM (EDT)
Hello Artybala,

Unfortunately, you will need to create a new XML or GSL grammar file in order to accomplish this task.  For more information on grammars, you may visit the following links:

http://docs.voxeo.com/voicexml/2.0/t_21.htm
http://docs.voxeo.com/voicexml/2.0/mot_appendixi.htm
http://docs.voxeo.com/voicexml/2.0/mot_appendixj.htm

Best regards,

Jeff Menkel
Voxeo Corporation
hotk
3/10/2008 9:44 PM (EDT)
hi there.

When I call a number given to me, I can hear "~~~ gate way software."

What is problem??
VoxeoDustin
3/10/2008 10:11 PM (EDT)
Hey HotK,

It looks like your application is using vxml version="1.0" and a Nuance specific DTD. You'll want to change the version to 2.0 or 2.1, which is what our platform currently uses and remove the reference to the Nuance DTD.

Also, in the future, you can open account tickets if you have questions regarding our platform. When you login to Evolution, click Support Tickets and then Open New Account Ticket.

Thanks,
Dustin
anishjhaveri
6/24/2008 8:17 AM (EDT)
Hi,

Excellent article! Thanks for the same.

I would like to know one thing.

Can I have a simple user's voice input which can be converted to text? I mean speech-to-text.

Lets say I would like to make an application where I can take user's view on some question which will be inputted as voice. Can I convert that voice input to text?

Looking forward to your reply.

Thanks,
Anish

VoxeoDustin
6/24/2008 11:10 AM (EDT)
Hey Anish,

Automated speech-to-text is a very difficult task to accomplish. There are some companies and software out there that may suit your needs, and a quick Google search should get you a bevy of information regarding it.

You may want to look into manual transcription services, which may be a cheaper and easier route that integrating a speech-to-text API.

Let us know if we can be of further assistance.

Cheers,
Dustin
roni
5/8/2009 1:38 PM (EDT)
Howdy,

I want to recognize a contact list which includes foreign names with unusual pronunciations.  How can I create new words to be recognized with custom pronunciations which I will supply?

Thanks,

-Roni


VoxeoDustin
5/8/2009 2:03 PM (EDT)
Hello Roni,

If you wish to recognize foreign names, you'll want to create phonetic utterances in your grammar.

<grammar type="application/grammar+xml" xml:lang="en-US" root="CONTACTS">
  <rule id="CONTACTS">
    <one-of>
      <item> lor ohn <tag> out.name = "Laurent" </tag> </item>
      <item> mee shell <tag> out.name = "Michelle" </tag> </item>
      <item> ghee ohm <tag> out.name = "Guillaume" </tag> </item>
    </one-of>
  </rule>
</grammar>

Obviously, this will take a bit of tweaking, but should certainly do the trick for you.

Regards,
Dustin Hayre
Customer Support Engineer II
Voxeo Support
amy2009
6/12/2009 3:06 AM (EDT)
I have written a grammar file as below:
<grammar type="text/gsl" weight="0">
<![CDATA[
[
(1 7 2 9 8 1)
(1 6 9 9 3 0)
(1 7 0 0 3 8)
(1 6 9 1 9 0)
(1 7 3 1 0 7)
(one eight two one four six) {<enteredid 182146>}
(one eight two one five zero)  {<enteredid 182150>}
]
]]>
</grammar>

When i prompt the voice input as 1 7 0 0 i get the output prompt as 1 7 0 0 3 8 i.e. it auto completes the remaining number. I do not want this feature enabled. I want it to match the entire number before giving the output or play a nomatch prompt.

I am using prophecy 8.0 server(free 2 ports) and it is installed on my machine.
voxeoJeffK
6/12/2009 4:37 AM (EDT)
Hello,

I've done some testing using the grammar you posted, and I am not encountering the same results. I got reliable nomatches when speaking incomplete entries. To help troubleshoot further for you may we ask if you could provide a logfile from an application test where this behavior is demonstrated?

Regards,
Jeff Kustermann
Voxeo Support
mindsick13
3/15/2010 12:52 PM (EDT)
Im using a variation of you code:

CODE

<vxml application="application-root.vxml" version="2.1" xmlns="http://www.w3.org/2001/vxml">

<form id="MainMenu">
    <field name="SouthParkCharacter">
      <!-- Since we are in a field tag, we do not need <prompt> tags surrounding the text-to-speech -->
      <prompt bargein="false">Please say your favorite South Park character's name.</prompt>

      <!-- Define our grammar -->
      <grammar type="text/gsl">
      <![CDATA[
        ;Match one of the enclosed terms
        [
          kenny cartman stan kyle
        ]
      ]]>
      </grammar>

      <!-- The user was silent, restart the field -->
      <noinput>
        I did not hear anything.  Please try again.
        <reprompt/>
      </noinput>


      <!-- The user said something that was not defined in our grammar -->
      <nomatch>
        I did not recognize that character.  Please try again.
        <reprompt/>
      </nomatch>
    </field>

    <!-- Set the namelist attribute to the name of the corresponding field -->
    <!-- This is filled only when one of the values in the grammar is matched -->
    <!-- That value is then sent to this section -->
    <filled namelist="SouthParkCharacter">
      <!-- Check the "SouthParkCharacter" variable against each of the valid values -->
      <!--  defined in our grammar -->
      <if cond="SouthParkCharacter == 'kenny'">
        <prompt>Kenny has more lives than a cat.</prompt>
      <elseif cond="SouthParkCharacter == 'cartman'"/>
        <prompt>Cartman is not fat.  He is big boned.</prompt>
      <elseif cond="SouthParkCharacter == 'stan'"/>
        <prompt>Stan likes Wendy.</prompt>
      <elseif cond="SouthParkCharacter == 'kyle'"/>
        <prompt>Kyle has a gay dog.</prompt>
      <else/>
        <prompt>
          A match has occurred, but no specific if statement
          was written for it.  Probably just a minor character
          like Tweak or Jimbo's gun-toting friend.
        </prompt>
      </if>
    </filled>
  </form>

<form id="DEFAULT_GOTO_ID">
<block>
<!-- filled in with link to next element at publish time -->
</block>
</form>
</vxml>



But unfortunatly is not working. Could you point any possible mistakes?

best regards,

Paulo Moura
VoxeoDante
3/15/2010 3:21 PM (EDT)
Hello Paulo,

I am afraid we don't have much to go on here with out a report of what the issue is, but I am going to guess that you are having issues with the voice recognition part of the application.

If that is the case, try replacing the grammar with the following;

<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root = "MYRULE">

  <rule id="MYRULE" scope="public">
    <one-of>
      <item>kenny</item>
      <item>cartman</item>
      <item>kyle</item>
      <item>stan</item>
    </one-of>
  </rule>
</grammar>

This is a GRXML type grammar and is the specification that will be used moving forward as the GSL spec was developed as Nuance specific, and they no longer support that format.

If that is not the part that you are having trouble with, let us know what part is giving you the problem and we will take a look.

Regards,
Dante Vitulano
Customer Support Engineer II
Voxeo Corporation
JonahKP
9/14/2010 3:44 PM (EDT)
I have copied this code directly from the page and the program will not recognize 'Terrance' or 'Phillip'.  It drops into the else cond. Also will not recognize 'Terrance Phillip'
jdyer
9/14/2010 4:50 PM (EDT)
Hello,

I am sorry to hear you are having issues here, might I ask that you please replicate the behavior with the application debugger open and submit logs? Generally we always request that applications logs accompany any application debugger requests, as this gives us insight into the execution of the application, and grammar, at the platform level, which is often required to resolve these types of issues.  We'll be standing by for your update at this time.

Regards,

John Dyer
Customer Engineer
Voxeo Support
james.li.hd
11/3/2010 9:35 PM (EDT)
Hi, Guys,

Don't know if anyone having the same problem with me.
I'm calling my app with skype, it's works ok except for that, after the call is answered, I can not hear the first few words. It's sounds like the system already started to prompt for one or two seconds before I can start to hear something.

Is this happened only on skype or this could possibly because I'm located in China?

Thanks
James

VoxeoDante
11/4/2010 10:44 AM (EDT)
Hello,

This is likely a little bit of both the geographical location and Skype together.  VoIP services will buffer the audio that is passed, this happens on both SIP phones and with Skype.  Generally the easiest way to work around this is to add a small break to the start of the TTS prompt to allow the buffer to build up before we start the speech.

You should be able to add a small tag to the start of the TTS to accomodate.

Try adding this <break time="500ms"/> at the beginning of the prompt.

I hope this helps.

Regards,
Dante Vitulano
Customer Engineer II
Voxeo Corp.

Have you seen the newest Voxeo labs creation?

http://blog.phono.com/
Semiliranda
6/2/2011 9:55 AM (EDT)
Hello!

Thank you for this tutorial!

Would you be so kind as to explane me the difference between these two blocks:

1.
      <nomatch>
        I did not recognize that character.  Please try again.
        <reprompt/>
      </nomatch>
    </field>


2.
      <else/>
        <prompt>
          A match has occurred, but no specific if statement
          was written for it.  Probably just a minor character
          like Tweak or Jimbo's gun-toting friend.
        </prompt>

When user is taken to (1) and when to (2)?

Thank you!
VoxeoDante
6/2/2011 11:29 AM (EDT)
Hello,

The first block (1) would be visited when someone was to say something that was not an item in the grammar.  The grammar in this tutorial is looking for one of a list of characters from the show.  If someone was to say something like "internet explorer" that would not match the grammar and the <nomatch> would be visited.

The second (2) would be visited when someone was to match the grammar, but none of the conditions in the large <if> / <else> are met.  You will notice that characters like "Tweak" are in the grammar, but are not part of the large <if> / <else>, this means that those grammar matches would fall out to the final <else>.

I hope that this explains everything.  Please let us know if there are any other questions.

Regards,
Dante Vitulano
Hosted Solutions Engineer

[url=http://voxeo.com/prophecy]Download Prophecy 10[/url] | [url=http://docs.voxeo.com/prophecy/10.0/home.htm]Prophecy 10 Docs[/url]
pauval08
12/20/2011 6:06 PM (EST)
Is there a method to capture keywords in a complex utterance? For instance, if the voice input is something like: "I would like the weather in Texas for next week", my system would recognize the word "weather" and forward the caller to the weather application.  Obviously, I could write a grammar with the entire response, but I'm looking for a method to detect keywords in complex utterances. Perhaps the confidence level would be very low, but thats not an issue.  Thanks!
voxeoJeffK
12/20/2011 6:47 PM (EST)
Hello,

You can use the special "GARBAGE" ruleref:

  http://www.vxml.org/ruleref.htm

Regards,
Jeff Kustermann
Voxeo Corporation
pauval08
12/25/2011 12:57 AM (EST)
Jeff,

Thank you.  Is there a similar element that will work with the Prophecy ASR?

-Paul
VoxeoDustin
12/25/2011 8:32 AM (EST)
Hey Paul,

The GARBAGE special should work with Prophecy ASR without issue.

Regards,
Dustin
steve33773
1/13/2012 8:06 PM (EST)
In my prompt I will ask the caller for a 5-digit code they saw on a sign or in an ad.  The code is printed in the format 21-354 (a two digit source code and a 3 digit property/product code separated by a dash).

Most callers respond with just the 5-digits but some say "two one DASH three five four".  I am looking for responses of only the 5 digits spoken.  Is there a simple way I can discard the spoken "dash" if the caller includes it in their response?   
VoxeoGarret
1/14/2012 9:54 PM (EST)
Hey there,

You certainly can, you just need to work a little magic on the grammar itself. As you can see from one of our example grammars:

[code]
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
          xml:lang="en-US" root = "MYRULE">

  <rule id="MYRULE" scope="public">

  <one-of>
    <item>

<!-- optional utterance prefixes go here -->
<!--  <item repeat="0-1">(some utterance)</item> -->

    <one-of>
      <item> gimli  <tag>          <![CDATA[  <F_1 "dwarves">  ]]>  </tag>  </item>
      <item> aragorn <tag>        <![CDATA[  <F_1 "men">  ]]>          </tag> </item>
      <item> legolas <tag>        <![CDATA[  <F_1 "elves">  ]]>        </tag> </item>
      <item> frodo <tag>          <![CDATA[  <F_1 "hobbits">  ]]>      </tag> </item>
      <item> rosie <tag>          <![CDATA[  <F_1 "cave trolls">  ]]>  </tag> </item>

    </one-of>

<!-- optional utterance suffixes go here -->
      <item repeat="0-1"> baggins </item>
      <item repeat="0-1"> o donnell </item>

    </item>
  </one-of>

  </rule>
</grammar>
[/code]

You can have an expect 2 digit input then the optional utterance of dash thrown in followed by the 3 final digits.

Regards,
Garrett King

Customer Support Engineer
Voxeo Corporation

login
  tutorial Hello World  |  TOC  |  tutorial Call Flow   

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