This topic has not yet been rated - Rate this topic

RecognizerInfo Class

Represents information about a SpeechRecognizer or SpeechRecognitionEngine.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public class RecognizerInfo

Identifying information for a running recognition engine can be obtained using the RecognizerInfo properties (SpeechRecognizer.RecognizerInfo and SpeechRecognitionEngine.RecognizerInfo) on the recognizer objects (SpeechRecognizer and SpeechRecognitionEngine).

A list of all supported SpeechRecognitionEngine configurations is expressed as a list of available RecognizerInfo instances obtained through the static method InstalledRecognizers.

Instances of RecognizerInfo can be used to construct an instance of SpeechRecognitionEngine with specific configuration using the SpeechRecognitionEngine(RecognizerInfo) constructor.

The information returned in instances of RecognizerInfo obtained from a SpeechRecognizer is determined through the Audio tab of the SpeechProperties member of the ControlPanel.

The example below validates a given [System.Globalization.CultureInfo] and ID string against the permitted SpeechRecognitionEngine configurations, expressed as a list of RecognizerInfo objects.

If the [System.Globalization.CultureInfo] and ID string validate, a new instance of SpeechRecognitionEngine is created using an appropriate instance of RecognizerInfo.


private SpeechRecognitionEngine SelectRecognizer(CultureInfo requiredCulture, string requiredId) {
    // Select based on a specific recognizer configuration:
    SpeechRecognitionEngine speechRecognitionEngine=null;
    foreach (RecognizerInfo config in SpeechRecognitionEngine.InstalledRecognizers()) {
        if (config.Culture.Equals(requiredCulture) && config.Id== requiredId) {
            speechRecognitionEngine = new SpeechRecognitionEngine(config);
            break;
        }
    }
    return speechRecognitionEngine;
}
System.Object
  System.Speech.Recognition.RecognizerInfo
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ