nuance.maskrecognitionlatency
The nuance.maskrecognitionlatency property is a Nuance extension that controls latency audio during recognition delays. In this context, a recognition delay refers to time interval between end-of-speech events and audio responses of subsequent prompts. Latency audio is controlled by the following VoiceXML properties:
- fetchaudio: Specifies the relative URL of an audio file. Since this property has no default value, you must set it in your application if you plan to use the nuance.maskrecognitionlatency property; otherwise, silence will be used during the fetchaudio loop.
- fetchaudiodelay: Controls the amount of time the interpreter waits before starting the fetchaudio loop. It is considered good practice to specify a few milliseconds of silence during recognition delays as opposed to immediately returning latency audio and cutting it off abruptly.
- fetchaudiominimum: Controls the minimum amount of time an audio file is supposed to play. Consider setting this property if the latency audio contains some fixed size message that must not be cut short.
- nuance.fetchaudiointerval: Controls the time interval between fetchaudio loops.
For example:
<form>
<!-- This fetchaudio URL applies to the standard resource
fetches (e.g. document and script) latencies as well.
-->
<property name="fetchaudio" value="smooth_jazz.wav"/>
<field>
<!-- Mask recognition latency for only this state. -->
<property name="nuance.maskrecognitionlatency" value="true"/>
<!--Begin masking immediately after the user has finished
speaking. This instruction makes sense in our case because we
know that we will experience a significant post-recognition
latency (see the <filled> block below) so even if the
recognition takes relatively little time, we may as well start
the mask as soon as possible.
-->
<property name="fetchaudiodelay" value="0s"/>
<!-- The prompt and grammar. -->
<prompt>What listing?</prompt>
<grammar src="complex_grammar.gram"/>
<!--This example uses a sleep to simulate post-recognition
delay. The point is that once latency audio has started
to play, it will not stop until an input state has been
reached. Thus the recognition latency audio also serves
to mask other application processing as well.-->
<filled>
<script>
var thread = Packages.java.lang.Thread.currentThread();
thread.sleep(10000, 0);
</script>
<goto next="next_state.vxml"/>
</filled>
</field>
</form>