次の方法で共有


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

SpeechRecognitionEngine.RecognizeAsync Method

Include Protected Members
Include Inherited Members

Starts an asynchronous speech recognition operation.

Overload List

  Name Description
Public method RecognizeAsync() Performs a single, asynchronous speech recognition operation.
Public method RecognizeAsync(RecognizeMode) Performs one or more asynchronous speech recognition operations.

Top

Remarks

These methods perform single or multiple, asynchronous recognition operations. The recognizer performs each operation against its loaded and enabled speech recognition grammars.

During a call to this method, the recognizer can raise the following events:

To retrieve the result of an asynchronous recognition operation, attach an event handler to the recognizer's SpeechRecognized event. The recognizer raises this event whenever it successfully completes a synchronous or asynchronous recognition operation. If recognition was not successful, the Result property on RecognizeCompletedEventArgs object, which you can access in the handler for the RecognizeCompleted event, will be a null reference (Nothing in Visual Basic).

An asynchronous recognition operation can fail for the following reasons:

  • Speech is not detected before the timeout intervals expire for the BabbleTimeout or InitialSilenceTimeout properties.

  • The recognition engine detects speech but finds no matches in any of its loaded and enabled Grammar objects.

The SpeechRecognitionEngine must have at least one Grammar object loaded before performing recognition. To load a speech recognition grammar, use the LoadGrammar or LoadGrammarAsync method.

To modify how the recognizer handles the timing of speech or silence with respect to recognition, use the BabbleTimeout, InitialSilenceTimeout, EndSilenceTimeout, and EndSilenceTimeoutAmbiguous properties.

To perform synchronous recognition, use one of the Recognize methods.

See Also

Reference

SpeechRecognitionEngine Class

SpeechRecognitionEngine Members

Microsoft.Speech.Recognition Namespace