Export (0) Print
Expand All

SpeechRecognitionEngine.EmulateRecognizeAsync Method (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.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

public void EmulateRecognizeAsync(
	string inputText,
	CompareOptions compareOptions


Type: System.String

The input phrase for the recognition operation.

Type: System.Globalization.CompareOptions

A bitwise combination of the enumeration values that describe the type of comparison to use for the emulated recognition operation.


The recognizer has no speech recognition grammars loaded, or the recognizer has an asynchronous recognition operation that is not yet complete.


inputText is null.


inputText is the empty string ("").


compareOptions contains the IgnoreNonSpace, IgnoreSymbols, or StringSort flag.

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 uses compareOptions when it applies grammar rules to the input phrase. The recognizers that ship with Vista and Windows 7 ignore case if the OrdinalIgnoreCase or IgnoreCase value is present. The recognizers always ignore the character width and never ignore the Kana type. The recognizers also ignore new lines and extra white space and treat punctuation as literal input. For more information about character width and Kana type, see the CompareOptions enumeration.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft