Skip to content

Instantly share code, notes, and snippets.

@mheadd
Created February 3, 2010 15:08
Show Gist options
  • Save mheadd/293667 to your computer and use it in GitHub Desktop.
Save mheadd/293667 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.1">
<!--
This work is licensed under a Creative Commons License
To review this license, go to http://creativecommons.org/licenses/by-sa/3.0/us/
-->
<meta name="maintainer" content="[email protected]" />
<!-- Set speech properties -->
<property name="sensitivity" value="0.4"/>
<property name="confidencelevel" value="0.2"/>
<!-- Flags to control DTMF fall back -->
<var name="speakFood" expr="true"/>
<var name="pressFood" expr="true"/>
<form id="F_1">
<block>
<prompt bargein="false">Welcome to the speech recognition demo.</prompt>
</block>
<nomatch>
<log>*** NOMATCH Confidence level: <value expr="application.lastresult$.confidence"/> ***</log>
<log>*** NOMATCH Utterance: <value expr="application.lastresult$.utterance"/> ***</log>
<log>*** NOMATCH Interpretation: <value expr="application.lastresult$.interpretation"/> ***</log>
<reprompt/>
</nomatch>
<nomatch count="2">
<log>*** NOMATCH Confidence level: <value expr="application.lastresult$.confidence"/> ***</log>
<log>*** TURN OFF SPEECH INPUT ***</log>
<assign name="speakFood" expr="false"/>
</nomatch>
<field name="interest" type="boolean">
<prompt>Are you interested in speech recognition?</prompt>
<filled>
<log>*** interest$.utterance: <value expr="interest$.utterance"/> ***</log>
<log>*** interest$.inputmode: <value expr="interest$.inputmode"/>***</log>
<log>*** interest$.interpretation: <value expr="interest$.interpretation"/>**</log>
<log>*** interest$.confidence: <value expr="interest$.confidence"/>***</log>
<log>*** interest: <value expr="interest"/>***</log>
</filled>
</field>
<field name="sayFavorite" cond="speakFood">
<prompt>Say the name of your favorite food. You can say pizza, steak or vegetables.</prompt>
<grammar xml:lang="en-US" root="R_1" mode="voice">
<rule id="R_1">
<one-of>
<item>pizza<tag>"1"</tag></item>
<item>steak<tag>"2"</tag></item>
<item>vegetables<tag>"3"</tag></item>
</one-of>
</rule>
</grammar>
<filled>
<log>*** sayFavorite: <value expr="sayFavorite"/> ***</log>
<assign name="pressFood" expr="false"/>
</filled>
</field>
<field name="pressFavorite" cond="pressFood">
<property name="inputmodes" value="dtmf"/>
<prompt>Please select your favorite food. For pizza, press 1, steak press 2, vegetables press 3.</prompt>
<grammar xml:lang="en-US" root="R_1" mode="dtmf">
<rule id="R_1">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
</one-of>
</rule>
</grammar>
<filled>
<log>*** pressFavoriteorite: <value expr="pressFavorite"/> ***</log>
</filled>
</field>
<block>
<foreach array="application.lastresult$" item="i">
<log>*** i.utterance: <value expr="i.utterance"/> ***</log>
<log>*** i.inputmode: <value expr="i.inputmode"/>***</log>
<log>*** i.interpretation: *<value expr="i.interpretation"/>**</log>
<log>*** i.confidence: <value expr="i.confidence"/>***</log>
</foreach>
</block>
<block>
<prompt>Enjoy your lunch. Goodbye.</prompt>
<exit/>
</block>
</form>
</vxml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment