Export (0) Print
Expand All

RecognizerInfo Class

Encapsulates identifying information about a recognition engine (SpeechRecognizer or SpeechRecognitionEngine).

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

public class RecognizerInfo
public class RecognizerInfo
public class RecognizerInfo
Not applicable.

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft