Freigeben über


endsilence Attribute

  Microsoft Speech Technologies Homepage

Specifies the period of silence, in milliseconds, at the end of an utterance, after which the recognition attempt is sent to the speech engine or recording is stopped. Optional.

<listen endsilence = "timeVal">

Remarks

The value of the endsilence attribute is ignored for single-mode recognitions. During recognition, the endsilence attribute provides a way to determine whether the user has stopped speaking (indicated by a significant pause) or is taking a brief speaking break (indicated by a shorter pause). If the threshold specified by endsilence is exceeded, recognition is stopped and the results of the recognition are returned to the listen element. During recording, the endsilence attribute specifies the length of silence required before recording is automatically stopped. If unspecified, the value of endsilence defaults to 1000 milliseconds. The minimum value allowed is 50; the maximum value is 60,000.

Example

The following code demonstrates the use of the endsilence attribute. Assuming an external grammar file, the page allows 5,000 milliseconds, or five seconds, after the last sound before considering the recognition to be complete.

<listen endsilence="5000" onreco="Handleonreco()" onnoreco="Handleonnoreco()" onsilence="Handleonsilence()" 
  onerror="Handleonerror()"> 
  <grammar src="gram1"></MyTest:grammar>
</listen>

See Also

listen Element