Partilhar via


status Property

  Microsoft Speech Technologies Homepage

Returns a status value indicating the success or failure of a recognition. Read-only.

statusVal = listen.status

Remarks

When a speech recognition concludes successfully, the value of the status property is set to zero. A non-zero value indicates that an error has occurred. The following table shows possible errors and their status values:

Status Value Description
  0 Normal no errors.
 -1 A generic Speech Platform error occurred during recognition.
 -2 Failed to find a Speech Platform (for distributed architectures).
 -3 An invalid property/attribute setting has caused a problem with the recognition request.
 -4 Failed to find a grammar resource.
 -5 Failed to load or compile a grammar resource.
 -6 Failed to activate or deactivate rules/grammars.
 -7 Time-out expired before recognition was complete.
 -8 Recognition was attempted without active grammars.
 -9 Recognition was attempted while another recognition was in progress.
-11 Recognizer did not detect speech within the period specified by the initialtimeout attribute.
-13 Sound was detected but no speech was recognized.
-14 Some speech was detected and interpreted but rejected with insufficient confidence.
-15 Speech was detected and interpreted, but a complete recognition was unable to be returned between speech detection and the interval specified in the babbletimeout attribute.
-20 Failed to record file locally.
-21 During recording, a unsupported CODEC was encountered.
-22 During recording, an unsupported format was encountered. If neither format nor CODEC are unsupported, only one of the values needs to be set.
-23 During recording, an error occurred while streaming audio to a remote server.
-24 An invalid property/attribute setting caused a problem with the recording request.
-30 Recognition was attempted after a disconnect.

Events that cause the status values to be set include onerror, onreco, onnoreco, and onsilence.

Example

The following code demonstrates the use of the status property. The following three functions display the status code from a listen element named listen1 for three common operations: an unsuccessful recognition from the onnoreco event, a silence time-out from the onsilence event, and an error condition from the onerror event. An event description and status is displayed in a text box named boxStatus

function Handleonnoreco() {
  boxStatus.value = "onnoreco fired " + listen1.status;
}

function Handleonsilence() {
  boxStatus.value = "onsilence fired " + listen1.status;
}

function Handleonerror() {
  boxStatus.value = "onerror fired " + listen1.status;
}

See Also

listen Element |  onerror Event |  onnoreco Event |  onreco Event |  onsilence Event