RecognizerInfo.SupportedAudioFormats Property
Gets the audio formats supported by a SpeechRecognitionEngine.
Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)
Syntax
'Declaration
Property Value
A System.Collections.ObjectModel.ReadOnlyCollection of SpeechAudioFormatInfo objects representing the audio formats supported by the SpeechRecognitionEngine.
Example
The example below implements a button click which displays all the information in a RecognizerInfo instance, including the encoding formats supported by a recognition engine configuration and obtained from SupportedAudioFormats, in a Windows.Forms.MessageBox.
private void recognizerInfoButton_Click(object sender, EventArgs e) {
RecognizerInfo info = _recognizer.RecognizerInfo;
string AudioFormats = "";
foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats) {
AudioFormats += String.Format(" {0}\n",
fmt.EncodingFormat.ToString());
}
string AdditionalInfo = "";
foreach (string key in info.AdditionalInfo.Keys) {
AdditionalInfo += String.Format(" {0}: {1}\n", key, info.AdditionalInfo[key]);
}
MessageBox.Show(String.Format(
"Name: {0 }\n" +
"Description: {1} \n" +
"SupportedAudioFormats:\n" +
"{2} " +
"Culture: {3} \n" +
"AdditionalInfo: \n" +
" {4}\n",
info.Name.ToString(),
info.Description.ToString(),
AudioFormats,
info.Culture.ToString(),
AdditionalInfo));
}
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 Class
RecognizerInfo Members
Microsoft.Speech.Recognition Namespace
RecognizerInfo Class
System.Collections.ObjectModel.ReadOnlyCollection
SpeechRecognizer
SpeechRecognitionEngine
SpeechAudioFormatInfo Class