We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Switching ASRs within a voice dialog

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sightplan
Posts: 17
Joined: Wed Feb 25, 2015 3:47 pm

Switching ASRs within a voice dialog

Post by sightplan »

Hey guys,

In testing out multi-language capabilities using the N9 ASR, I wanted to make sure that I'm actually hitting the es-US ASR properly: While the code & grammar execute just fine, the logs for both "current" and "recent" calls don't output anything that confirms whether the code below invokes the English or Spanish ASR:



== DIALOG.xml ==

Code: Select all

<?xml version="1.0" encoding="UTF-8"?> 
<vxml version="2.1" application="appRoot.xml" xml:lang="en-US">

 <form id="enterTask">
  <field name="issueType">
   <grammar type="application/srgs+xml" srcexpr="'spanGram.grxml'"/>
    <audio expr="'Spanish-enterInput.wav'"/>
   <filled/>
  </field>
 </form>
</vxml>


== spanGram.gxml ==

Code: Select all

<?xml version="1.0"?>
 <grammar type="application/srgs+xml" root="DETAIL_RULE" mode="voice" xml:lang="es-US">
  <rule id="DETAIL_RULE">
   <one-of>
    <item>bañera</item>
   </one-of>
  </rule>
 </grammar> 

My question: From the documents above, the vxml file uses the default en-US ASR. Is it sufficient to specify an xml:lang="es-US" within the external grammar file to switch to Spanish ASR in this case, or:

a) Is it required that I also specify es-US when I call the grammar within the vxml document?
b) Is it required that I set the xml:lang within the <vxml> tag?


If you guys can shed some light on this, it would be greatly appreciated. I'd also make a suggestion to consider outputting log lines that makes this a bit more clear to developers, as I'd imagine that others might find this to be useful as well.


Thanks,

Matt

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Switching ASRs within a voice dialog

Post by support »

Hi Matt,

To answer your questions, for this specific example:

a) No, it is not required for you to specify es-US in the <grammar> tag within the vxml document.
b) No, it is not required for you to set the xml:lang in the <vxml> tag.

From a general perspective, if grammar elements do not have a specified xml:lang attribute, it will try to inherit the attribute from its parent elements. Since, in your example, the external grammar already has an xml:lang attribute of "es-US", it will use Spanish as the language instead of inheriting it upstream.

While we do not have anything specific to this in our documentation, you may find the Grammar > Language entry in the SRGS documentation useful.

We have also recorded your request for logging of this sort of information in our internal feature request tracker for future consideration.

Regards,
Plum Support

Post Reply