SpeechRecognitionEngine.EmulateRecognizeAsync Method

Provides support for asynchronous simulation of audio input to support testing and debugging.

Remarks

The EmulateRecognizeAsync object allows for testing and debugging of the applications and grammars using asynchronous recognition technology without dependency on a system’s audio input technology.

Instead of using audio information as input, the EmulateRecognize methods can accept a string or an array of RecognizedWordUnit objects as an argument.

The EmulateRecognizeAsync methods return void. Therefore, applications can only obtain results from asynchronous emulation of speech recognition by handling the events that would be produced by actual audio input: SpeechDetected, SpeechHypothesized, SpeechRecognitionRejected, SpeechRecognized.

On completion, rather than generating a RecognizeCompleted event, a EmulateRecognizeAsync operation generates a EmulateRecognizeCompleted event, which receives a EmulateRecognizeCompletedEventArgs object (which is derived from AsyncCompletedEventArgs as an argument.

Note

When emulating recognitionthe Audio property on the RecognitionResult will be null.

Emulated recognition ignores new lines and extra white space and treats punctuation literally, rather than letting it define phrases.

Synchronous simulation can be obtained through EmulateRecognize.

SpeechRecognizeEmulateRecognizeEmulateRecognize(System.String,System.Globalization.CompareOptions)EmulateRecognizeAsyncEmulateRecognizeAsyncRecognizedWordUnit

Overload List

Name Description
SpeechRecognitionEngine.EmulateRecognizeAsync (String)
Asynchronously simulate audio input to the recognition engine with string.
SpeechRecognitionEngine.EmulateRecognizeAsync (RecognizedWordUnit[], CompareOptions)
Asynchronously simulate audio input to the recognition engine with an array of RecognizedWordUnit objects and specified case sensitivity.
SpeechRecognitionEngine.EmulateRecognizeAsync (String, CompareOptions)
Asynchronously simulate audio input to the recognition engine with a string and specified case sensitivity.

See Also

Reference

SpeechRecognitionEngine Class
SpeechRecognitionEngine Members
Microsoft.Speech.Recognition Namespace
SpeechRecognize
SpeechRecognitionEngine.EmulateRecognize Method
SpeechRecognitionEngine.EmulateRecognizeAsync Method
EmulateRecognizeCompleted
SpeechRecognize
SpeechRecognitionEngine.EmulateRecognize Method
SpeechRecognitionEngine.EmulateRecognize Method
(System.String,System.Globalization.CompareOptions)
SpeechRecognitionEngine.EmulateRecognizeAsync Method
SpeechRecognitionEngine.EmulateRecognizeAsync Method
RecognizedWordUnit Class