maxtimeout Attribute
Specifies the maximum allowable time, in milliseconds, between the beginning of a recognition and when results are returned to the interpreter. Optional.
HTML | <listen maxtimeout="timeVal"> |
JScript | listen.maxtimeout = "timeVal" |
Remarks
This attribute provides a means to stop a recognition process if the results take too long to be returned. This case anticipates network errors or problems. A network is considered not available or a recognizer has failed if the maxtimeout attribute value is exceeded. If exceeded, an onerror event is thrown by the browser. This event may occur with network or recognizer failure in distributed environments.
For recognition in multiple mode, as with babbletimeout, the period is restarted after the return of each recognition or other event. For both clients (Speech Add-in for Microsoft Internet Explorer and Speech Add-in for Microsoft Pocket Internet Explorer), the maxtimeout attribute must be greater than or equal to the sum of initialtimeout and babbletimeout attributes. No such restriction exists for telephony applications.
For client recognitions in automatic mode, the maxtimeout attribute should be greater than or equal to the sum of initialtimeout, babbletimeout, and endsilence. Again, no such restriction exists for telephony applications.
The maxtimeout timer does not start when an application is interacting with the Speech Debugging Console. Therefore, if the attribute is exceeded when Speech Debugging Console is active and Break on Listen is selected in Speech Debugging Console start up settings, the onerror event will not occur.
For clients, the minimum value allowed is 5051; the maximum is 140000. If not specified, the default value is the 140000. For telephony applications, the default value is 120000, the minimum is 5051 while the maximum is 2147483647(MAX_INT).
Example
The following code demonstrates the use of the maxtimeout attribute. This listen element allows 10000 milliseconds, or ten seconds, before assuming the recognition engine is not available.
<listen maxtimeout="10000" onreco="Handleonreco()" onnoreco="Handleonnoreco()"
onsilence="Handleonsilence()" onerror="Handleonerror()">
<grammar src="./cities.grxml" />
</listen>
See Also
listen Element | babbletimeout Attribute | initialtimeout Attribute