initialtimeout Attribute
Specifies the maximum allowable time, in milliseconds, between the beginning of recognition/recording, or the end of a prompt, and speech detection. Optional.
HTML | <listen initialtimeout="timeVal"> |
JScript | listen.initialtimeout = "timeVal" |
Remarks
The initialtimeout attribute provides a way to stop a recognition process if it is apparent that no speech is available. The initialtimeout attribute establishes the time, in milliseconds, between the start of recognition or recording (if there is no prompt in playback) or the end of the prompt (if there is a prompt in playback) and the detection of speech. If this maximum time period is exceeded, an onsilence event occurs. If not specified, initialtimeout defaults to 3000. The minimum value allowed is 1; the maximum is 60000. A value of 0 disables the time-out.
Example
The following code demonstrates the use of the initialtimeout attribute. This listen element allows 5000 milliseconds, or five seconds, before stopping the recognition process and initiating an onsilence event.
<listen initialtimeout="5000" onreco="Handleonreco()" onnoreco="Handleonnoreco()"
onsilence="Handleonsilence()" onerror="Handleonerror()">
<grammar src="./cities.grxml" />
</listen>