Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== VoiceXML Example : Speech Recognition ===== **Simple inline grammar** <code> <?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="es-ES"> <property name="confidencelevel" value="0.6"/> <property name="inputmodes" value="voice"/> <form id="deck"> <field name="name"> <grammar xml:lang="es-ES" root="name"> <rule id="name"> <one-of> <item>chocolate <tag>chocolate</tag> </item> <item>vainilla <tag>vainilla</tag> </item> </one-of> </rule> </grammar> <prompt>¿Que prefiere, el chocolate o la vainilla ?</prompt> </field> <filled> <prompt>Usted ha dicho <value expr="name"/> </prompt> </filled> </form> </vxml> </code> The VoiceXML browser will use an grammar definied in the document. This is a case of a SRGS/GRXML simple grammar. Download : [[http://links.i6net.com/vxml_examples/vestec/vestec1.vxml|vestec1.vxml]] **Simple ABNF reference grammar** <code> <?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="es-ES"> <form> <property name="inputmodes" value="voice"/> <property name="timeout" value="5s"/> <field name="text"> <grammar mode="voice" src="yesno_es.grm"/> <catch event="noinput nomatch"> <reprompt/> </catch> <prompt> Por favor diga, si o no </prompt> </field> <filled> <prompt> Ha dicho : <value expr="text.Yesno" /> </prompt> <clear namelist="text" /> </filled> </form> </vxml> </code> <code> /* Vestec Automatic Speech Recognition Engine Version 1.0 Copyright (c) 2009 Voice Enabling Systems Technology, Inc. All rights reserved. */ #ABNF 1.0; $Yesno = $Yes {si} | $No {no}; $Yes = si | sip | claro ; $No = no ; </code> The VoiceXML browser will use a grammar file with the ABNF syntax. Download : [[http://links.i6net.com/vxml_examples/vestec/vestec2.vxml|vestec2.vxml]] [[http://links.i6net.com/vxml_examples/vestec/yesno_es.grm|yesno_es.grm]] examples/speech.txt Last modified: 2016/09/21 06:48by borja