This documentation is archived and is not being maintained.

SpeechRecognitionEngine.Recognize Method

Starts a synchronous speech recognition operation.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Public method Recognize() Performs a synchronous speech recognition operation.
Public method Recognize(TimeSpan) Performs a synchronous speech recognition operation with a specified initial silence timeout period.

These methods perform a single, synchronous recognition operation. The recognizer performs this operation against its loaded and enabled speech recognition grammars.

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

The recognizer does not raise the RecognizeCompleted event when using one of the Recognize() methods.

The Recognize methods return a RecognitionResult object, or null if the operation is not successful or the recognizer is not enabled.

A synchronous recognition operation can fail for the following reasons:

  • Speech is not detected before the timeout intervals expire for the BabbleTimeout or InitialSilenceTimeout properties, or for the initialSilenceTimeout parameter of the Recognize(TimeSpan) method.

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

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

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 perform asynchronous recognition, use one of the RecognizeAsync methods.