RecognizerInfo.Culture Property

Gets the culture of a SpeechRecognitionEngine.

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

Syntax

'Declaration




Property Value

Returns an instance of System.Globalization.CultureInfo, containing information about the culture supported by a given SpeechRecognitionEngine, including the name of the culture, the writing system, the calendar used, and how to format dates and sort strings.

Example

The example below implements a button click which displays all the information in a RecognizerInfo instance, including the identifying string for the System.Globalization.CultureInfo used by the recognition engine configuration and obtained using Culture.

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
System.Globalization.CultureInfo
RecognizerInfo Class
SpeechRecognitionEngine