This documentation is archived and is not being maintained.

SpeechRecognitionEngine.EmulateRecognize Method

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

Name Description
SpeechRecognitionEngine.EmulateRecognize (String) Synchronously simulate audio input to the Windows Desktop Speech Technology recognition engine with a String.
SpeechRecognitionEngine.EmulateRecognize (RecognizedWordUnit[], CompareOptions) Synchronously simulate audio input to the Windows Desktop Speech Technology recognition engine with an array of RecognizedWordUnit objects and specified case sensitivity.
SpeechRecognitionEngine.EmulateRecognize (String, CompareOptions) Synchronously simulate audio input to the Windows Desktop Speech Technology recognition engine with a String and specified case sensitivity.

The EmulateRecognize object allows for testing and debugging of the applications and grammars using synchronous 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.

Applications obtain results from synchronous emulation of speech recognition either by the instance of RecognitionResult returned by EmulateRecognize, or by handling the events that would be produced by actual audio input: SpeechDetected, SpeechHypothesized, SpeechRecognitionRejected, SpeechRecognized.

NoteNote:

When emulating recognition the Audio property on a RecognitionResult object will be a null reference (Nothing in Visual Basic).

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

Asynchronous simulation can be obtained through EmulateRecognizeAsync.

SpeechRecognize EmulateRecognizeAsync RecognizedWordUnit
Show: