dcsimg
October 18, 2018
Hot Topics:

VoiceXML Adventure Game

  • December 1, 2002
  • By Jonathan Eisenzopf
  • Send Email »
  • More Articles »

Next, we need to add handlers for the nomatch and noinput events using the methods specified in Page 4 of the previous tutorial.

Example 3.

<?xml version="1.0"?>
<vxml version="1.0">
<form>
<field name="answer">
<grammar> <![CDATA[
[
[dtmf-1 one] {<option "door1">}
[dtmf-2 two] {<option "door2">}
[dtmf-3 three] {<option "door3">}
[(touch the monkey)] {<option "monkey">}
]
]]>
</grammar>
<prompt> <audio>You are in a small room with three doors.</audio>
<pause>300</pause>
<audio>To open the first door, press or say 1.</audio>
<pause>300</pause>
<audio>To open the second door, press or say 2.</audio>
<pause>300</pause>
<audio>To open the third door, press or say 3.</audio>
</prompt>
<nomatch>
<audio>You fool! That is not a choice I am giving you.</audio>
<pause>300</pause>
<audio>Press or say 1, 2, or 3.</audio>
<listen/>
</nomatch>
<noinput>
<audio>What are you waiting for?</audio>
<pause>300</pause>
<audio>Press or say 1, 2, or 3.</audio>
<listen/>
</noinput>
</field>
<filled>
<result name="door1">
<audio>You see a large hungry monkey.</audio>
<reprompt/>
</result>
<result name="door2">
<audio>You see another room with three doors, a man, and his monkey.</audio>
<reprompt/>
</result>
<result name="door3">
<audio>You see a man scratching his monkey.</audio>
<reprompt/>
</result>
<result name="monkey">
<audio>No! Do not touch the monkey!</audio>
<reprompt/>
</result>
</filled>
</form>
</vxml>




Page 4 of 7



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date