endsilence Attribute

  Microsoft Speech Technologies Homepage

Specifies, in milliseconds, the period of time when the dual tone multi-frequency (DTMF) input matches a complete path through the grammar, but further input is still possible. Optional.

HTML <dtmf endsilence="timePeriod">
JScript dtmf.endsilence = timePeriod

Remarks

The endsilence attribute specifies the time period during which further DTMF input is allowed after a complete match with an active grammar element.

Once the time period elapses, the onreco event is raised. For a complete grammar match where further input is not possible, the endsilence attribute is not required, and the onreco event is raised immediately.

The range of values that can be assigned to the endsilence attribute is from 0 to 60000 milliseconds, inclusive. If the endsilence attribute is omitted, the value of the interdigittimeout attribute is used by default. If the programmer attempts to enter a value that is outside the acceptable range, the nearest in-range value is used.

Example

The following code demonstrates the use of the endsilence attribute.

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  ...
  <body>
    <input type="text" name="iptAreaCode" onFocus="dtmfAreaCode.Start()" />
    <input type="text" name="iptPhoneNumber" />
    ...
    <salt:dtmf id="dtmfAreaCode" onkeypress="dtmfKeyPressHandler()" onreco="dtmfPhoneNumber.Start()"    onsilence="dtmfSilenceHandler()" onerror="dtmfErrorHandler()" onnoreco="dtmfErrorHandler()"    initialtimeout="5000" interdigittimeout="2000" preflush="true">
      <!-- grammar result will contain "smlAreaCode" node -->
      <salt:grammar src="3digits.grxml" />
      <salt:bind value="//smlAreaCode" targetelement="iptAreaCode" />
    </salt:dtmf>
    <salt:dtmf id="dtmfPhoneNumber" onkeypress="dtmfKeyPressHandler()" onerror="dtmfErrorHandler()"    initialtimeout="5000" interdigittimeout="2000" preflush="true">
       <!-- grammar result will contain "smlPhoneNumber" node -->
      <salt:grammar src="7digits.grxml" />
      <salt:bind value="//smlPhoneNumber" targetelement="iptPhoneNumber" />
    </salt:dtmf>
    <script language="jscript">
    <!--
      function dtmfSilenceHandler() {
        ...
      }
  
      function dtmfErrorHandler() {
        ...
      }
      
      function dtmfKeyPressHandler() {
        ...
      }
      -->
      </script>
  <body>
</html>

See Also

dtmf Element