Showing 6 results.
Items per Page 50
of 1

CVP Forum

« Back to General Discussion

VAudio: error.semantic

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hello,
 
I'm trying to play an Audio file in VoiceElement class and it doesn't seems to be working.
 
Please see the code and let me know if there is any issues..
 
 
 


 
 
 

VPreference pref = voiceElementData.getPreference();
<font size="2">
VForm form = VForm.getNew(pref,
</font>
 
"start"
);<font size="2">
 
</font>
 
//VForm form = VForm.getNew(pref, "PromoMsg");

VBlock block = VBlock.getNew(pref);
<font size="2">
 
</font>
 
//VAudio promoMessage = VAudio.getNew(pref,audioPath, audioFile,"File Not Found", audioFileType, false);
<font size="2">
VAudio promoMessage = VAudio.getNew(pref,
</font>
 
"en-us/app/", "80060","File Not Found", "wav", false
);
 
<font size="2">
VAction addAction = VAction.getNew(pref, VAction.
</font>
 
EXIT, super
.getSubmitURL());
 
 
<font size="2">
block.add(promoMessage);
</font>
 
// Add the audio to the block.
<font size="2">
block.add(addAction);
</font>
 
// Add the action to the block (occurs after the audio or won't hear it).
<font size="2">
form.add(block);
</font>
 
// Add the block to the myOtherForm form.

vxml.add(form);

Please provide more details. What are you seeing in the logs? 

RE: VAudio: error.semantic
vactio vaudio
Answer
11/16/10 1:44 AM as a reply to Hemal Mehta.
Please provide more details. What are you seeing in the logs? 

Thank you for the quick response. I was able to get this to work.
 
My problem was that I was generating proper Voice XML file.
 
In the log file I was seeing "error.semantic"
 
Solution was to Submit the page by creating proper VAction object.

 
 
 
 

VPreference pref = voiceElementData.getPreference();
 
<font size="2">
 
</font>
// Set a page-scope property.
 
 

 



 

 
 
 
 
 
 
 
 
<font size="2">
 
</font>
 
 
<font size="2">
vxml.setProperties(VProperty.getNew(pref,
</font>
 
"someProperty", "someValue"
));
 
<font size="2">
 
</font>
 
// Make a page-scope variable.
<font size="2">
vxml.add(
</font>
 
"myVar", "playing audio ", VMain.WITH_QUOTES
);
 
<font size="2">
VForm form = VForm.getNew(pref,
</font>
 
"start"
);
VBlock block = VBlock.getNew(pref);
 
<font size="2">
promoAudioFileName = Constant.
</font>
 
PROMO_MESSAGE_50 + "."
+ audioFileType;
promoAudioFileName = audioPath + promoAudioFileName;
 
<font size="2">
 
</font>
 
this.logToActivityLog(voiceElementData,currentMethod, "File to be played: "
+ promoAudioFileName);
 
<font size="2">
VAudio promoMessage = VAudio.getNew(pref, AudioFileName, VAudio.
</font>
 
FILENAME_ONLY
);
 
<font size="2">
 
</font>
 
// Disable Bargein (key over)
<font size="2">
promoMessage.
</font>
 
bargein = false
;
 
<font size="2">
 
</font>
 
//VAudio promoMessage2 = VAudio.getNew(pref, "http://10.3.254.204/en-us/app/eng/80060.wav", VAudio.FILENAME_ONLY);

 
<font size="2">
block.add(promoMessage);
</font>
 
// Add the audio to the block.
<font size="2">
 
</font>
 
//block.add(promoMessage2); // Add the audio to the block.

 
<font size="2">
 
</font>
 
//Not Sure why i'm doing this but, you have to inorder generate a proper Voice XML Page
<font size="2">
VAction submitAction = getSubmitVAction(
</font>
 
"myVar"
, pref);
 
<font size="2">
block.add(submitAction);
</font>
 
// Add the action to the block (occurs after the audio or won't hear it).
<font size="2">
form.add(block);
</font>
 
// Add the block to the myOtherForm form.
<font size="2">
vxml.add(form);
</font>
 
// Add myOtherForm to the VMain object. <font size="2" color="#3f7f5f"><font size="2" color="#3f7f5f">
 
</font></font><font size="2" color="#3f7f5f">
 
</font>
 
 <font size="2">
 
</font>