Share via


timer Attribute

  Microsoft Speech Technologies Homepage

Specifies the time, in milliseconds, before an ontimeout event is initiated. Optional.

HTML <smex timer="timeout">
JScript smex.timer = timeout

Remarks

Because communication between the smex element and the Speech Platform is asynchronous, it may be useful for the speech application programmer to establish a time period to wait for a message from the platform. If the established time period elapses without receiving a message, the programmer can then take whatever action is appropriate when the ontimeout event occurs.

Countdown begins when the timer attribute is assigned a positive value, which may occur on document load, if the attribute is specified declaratively. The value can be changed while a countdown is in progress. A zero or negative value stops the clock without triggering the ontimeout event. The default is 0, meaning no time-out is set.

It should be noted that the timer operates completely independently of the smex element. It begins when it is assigned a positive value, and ends when that time period has elapsed. It has no direct relationship between sending and receiving message to or from the Speech Platform, other than the one established by the speech application programmer.

Example

The following code demonstrates the use of the timer attribute.

<smex id="mySmex" onreceive="onSmexReceive()" onerror="onSmexError()" ontimeout="onSmexTimeout()" timer="5000"/>

See Also

smex Element |  timeout Event