SpeechRecognitionEngine.InstalledRecognizers Method
Returns a list of all available recognition engines on a system.
Assembly: System.Speech (in System.Speech.dll)
Return Value
Type: System.Collections.ObjectModel.ReadOnlyCollection<RecognizerInfo>Returns an instance of ReadOnlyCollection containing an instance of RecognizerInfo fully specifying each recognition engine available on a system supporting the Speech platform.
The example below queries the system using InstalledRecognizers to find a recognition engine with the identification string and CultureID.
Before before this instance of SpeechRecognitionEngine can be used, it must have its input set, using SetInputToNull, SetInputToWaveStream, or SetInputToDefaultAudioDevice).
private SpeechRecognitionEngine SelectRecognitionEngine(CultureInfo requiredCulture, string requiredId) {
// Select based on a specific recognitionEngine configuration:
SpeechRecognitionEngine speechRecognitionEngine=null;
foreach (RecognzierInfo config in SpeechRecognitionEngine.InstalledRecognizers()) {
if (config.Culture.Equals(requiredCulture) && config.Id== requiredId) {
speechRecognitionEngine = new SpeechRecognitionEngine(config);
break;
}
}
return speechRecognitionEngine;
}
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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.