Note

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

SpeechRecognitionEngine.EmulateRecognizeAsync Method

Include Protected Members
Include Inherited Members

Emulates input to the speech recognizer, using text in place of audio for asynchronous speech recognition.

Overload List

  Name Description
Public method EmulateRecognizeAsync(String) Emulates input of a phrase to the speech recognizer, using text in place of audio for asynchronous speech recognition.
Public method EmulateRecognizeAsync(String, EmulateOptions) Emulates input of a phrase to the speech recognizer, using text in place of audio for asynchronous speech recognition, and specifies the type of recognition operation to perform.
Public method EmulateRecognizeAsync(String, CompareOptions) Emulates input of a phrase to the speech recognizer, using text in place of audio for asynchronous speech recognition, and specifies how the recognizer handles Unicode comparison between the phrase and the loaded speech recognition grammars.
Public method EmulateRecognizeAsync([], CompareOptions) Emulates input of specific words to the speech recognizer, using text in place of audio for asynchronous speech recognition, and specifies how the recognizer handles Unicode comparison between the words and the loaded speech recognition grammars.
Public method EmulateRecognizeAsync(String, CompareOptions, EmulateOptions) Emulates audio input to the recognition engine, using text in place of audio for asynchronous speech recognition, specifies how the recognizer handles Unicode comparison between the phrase and the loaded speech recognition grammars, and specifies the type of recognition operation to perform.
Public method EmulateRecognizeAsync([], CompareOptions, EmulateOptions) Emulates input of specific words to the speech recognizer, using an array of RecognizedWordUnit objects in place of audio for asynchronous speech recognition, specifies how the recognizer handles Unicode comparison between the words and the loaded speech recognition grammars, and specifies the type of recognition operation to perform.

Top

Remarks

These methods bypass the system audio input and provide text to the recognizer as String objects or as an array of RecognizedWordUnit objects. These methods can be helpful when you are testing or debugging an application or a grammar.

Using the EmulateOptions parameter, you can specify one of three types of recognition operation:

  • Emulation. Uses text instead of audio as input to the speech recognition engine to perform recognition.

  • IdentifyConfusion. Identifies phrases in a grammar that may generate false acceptances on recognition because of similarity to other phrases in the grammar.

  • Simulation. Creates an 'idealized' audio representation of the input phrase (based on the speech recognition engine's lexicon and acoustic model), and then performs recognition on the idealized audio.

See EmulateOptions for more information.

Use the SetInputToNull() method to disable audio input to the speech recognition engine during emulation operations.

The speech recognizer raises the SpeechDetected, SpeechHypothesized, SpeechRecognitionRejected, and SpeechRecognized events as if the recognition operation is not emulated. When the recognizer completes the asynchronous recognition operation, it raises the EmulateRecognizeCompleted event. The recognizer ignores new lines and extra white space and treats punctuation as literal input.

Note

The RecognitionResult object generated by the speech recognizer in response to emulated input has a value of a null reference (Nothing in Visual Basic) for its Audio property.

To emulate synchronous recognition, use the EmulateRecognize method.

See Also

Reference

SpeechRecognitionEngine Class

SpeechRecognitionEngine Members

Microsoft.Speech.Recognition Namespace

SpeechRecognizedEventArgs

EmulateRecognize

EmulateRecognize

EmulateRecognizeAsync

EmulateRecognize

RecognizedWordUnit

EmulateOptions

Other Resources

Microsoft Grammar Development Tools