| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>"/> <menu id="menu"> <prompt>What would you like for lunch? To choose <enumerate> <value expr="_prompt"/>, press <value expr="_dtmf"/> </enumerate> </prompt> <choice next="#F1" dtmf="1"> ham and cheese </choice> <choice next="#F1" dtmf="2"> grits </choice> <choice next="#F1" dtmf="3"> ham and shatner </choice> </menu> <form id="F1"> <block> <prompt> eat it up, yummy! </prompt> </block> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
shinde_pallavi
|
|
| How can we specify an audio file if we do not want the enumerate element to list choices using TTS?
|
|
MattHenry
|
|
| Hi there,
I'm initially not seeing this as being possible by using the menu/enumerate elements. Instead, you may wish to use a more traditional form/field approach, and using some client-side scripting in conjunction with the <audio expr> element/attribute to achieve this in your code. ~Matt |
|
PUNUKA
|
|
| hey matthenry
I am currently writting a test applications for voice xml. How can I enumerate a list of choices using audio files instead of tts? currently I dont have a tts implemented in my platform? beside can I pass the wave files to _prompt variable of enumerate? how do I do that using scripts?... remember I am just few months old in vxml |
|
MattHenry
|
|
|
Hi there, I think if you wanted to do this, then you would need to emulate the functionality of the <enumerate> element by using the <foreach> element, and having a <field> immediately follow this. As a non-specific example, consider this as a starting point: <block name="progHolderPrompt"> <var name="counter" expr="Number(1);"/> <foreach item="myItem" array="myArray"> <prompt> <audio expr="audioDir + 'callingAbout.wav'"> If you wish to choose </audio> <value expr="myItem"/> <break/> <audio src="press.wav"> press </audio> <value expr="counter"/> </prompt> </foreach> </block> <field name="myChoice"> .. </field> This snippet assumes that you have a grammar in the <field> that matches your <foreach> choice options for both dtmf and voice input, and a handler for you counter variable that is synched up with the array length: If there are only three choices available, we need to make sure that the caller is reprompted if they press "4", you see. Hope that this helps to get you started! ~Matthew Henry |
|
deepu
|
|
| Hi,
I want solution for this question. I have the vxml file likr this: ( <?xml version="1.0"?> <vxml version="2.0"> <var name="MyVarExpr" expr="'#M2'"/> <menu id="M1"> <prompt> say one to test the choice element . <enumerate> <value expr="_prompt"/>, press <value expr="_dtmf"/> </enumerate> </prompt> <choice next="#F1" dtmf="1"> apple and mango </choice> <choice next="#F1" dtmf="2"> coffee or tea </choice> </menu> <form id="F1"> <block> <prompt> <value expr="_dtmf" /> eat it up, yummy! </prompt> </block> </form> </vxml> in this if i pressed choice as 1 ,i have to get that choice 1 in the form.Is it possible? if yes please give me a solution for this one. Thanks, Deepa |
|
MattHenry
|
|
|
Hello Deepa, In looking at your code, I don't see anything wrong with it; can you provide us with a bit more detail as to exactly what it is that is not working for you? It may also help to include application debug logs to give us some context, per the below links: http://www.voicexmlguide.com/gettingsupport.htm http://www.voicexmlguide.com/loggerfeatures.htm ~Matthew Henry |
|
deepu
|
|
| Hi Matthew,
First of all thanks for your response. The code is working fine.But, what my need is i have to get the choice value in the form. i.e, if i pressed 1 then its going to form item, there i have to get the value that i have pressed 1 like that. Main requirement for me is,i have to get the choice value in the form item. if it is not clear for u once again i will send the details. Thanks, Deepa. |
|
sidvoxeo
|
|
| Deepa,
There is a work around for getting the value you have pressed in the form item. Have look at the snippet of code and let me know if it makes sense. <var name="myChoice"/> <catch event="myEvent"> <assign name="myChoice" expr="_message"/> <!--Here you can have a if condition logic which checks for the value of "_message" and then takes you to different forms --> <goto next=""/> </catch> <choice event="myEvent" dtmf="1" message="'1'"> choice one </choice> <choice event="myEvent" dtmf="2" message="'2'"> choice two </choice> Regards Sid |
|
PUNUKA
|
|
| hi deepu
I thinik to get the _dtmf value your can use the document level variables to capture the value and from the form you can display the _dtmf value... you can reach me on ebarnabas@triviumsys.com for more details |
|
PUNUKA
|
|
| hi henry
can use the audio tag as _prompt for the enumerate? that is can i in the choice element embed the audio element that play is played as _prompt for enumerate? instead of using foreach element? |
|
MattHenry
|
|
|
Hi there, That was actually the first question asked in this documentation posting. Per my testing, the <audio expr> is not suitable for outputting data in conjunction with the <enumerate> tag. You can however, use the workaround that I provided where you use the <foreach> element. ~Matthew Henry |
| login |