RecognizerInfo Class

Represents information about a SpeechRecognitionEngine.

Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)

Syntax

'Declaration
Public Class RecognizerInfo
public class RecognizerInfo
public ref class RecognizerInfo
public class RecognizerInfo
public class RecognizerInfo

Remarks

Identifying information for a running recognition engine can be obtained using the SpeechRecognitionEngine.RecognizerInfo property on the 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.

Inheritance Hierarchy

System.Object
Microsoft.Speech.Recognition.RecognizerInfo

Example

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;
}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

RecognizerInfo Members
Microsoft.Speech.Recognition Namespace
SpeechRecognitionEngine