다음을 통해 공유


RecognizerInfo.Culture Property

Definition

Gets the culture supported by a SpeechRecognizer or SpeechRecognitionEngine instance.

public:
 property System::Globalization::CultureInfo ^ Culture { System::Globalization::CultureInfo ^ get(); };
public System.Globalization.CultureInfo Culture { get; }
member this.Culture : System.Globalization.CultureInfo
Public ReadOnly Property Culture As CultureInfo

Property Value

Returns information about the culture supported by a given SpeechRecognizer or SpeechRecognitionEngine instance.

Examples

The following example implements a button click that displays all the information in a RecognizerInfo instance. The example uses the Culture property to obtain the identifying string for the CultureInfo used by the recognition engine configuration.

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

Remarks

A CultureInfo object can include the name of the culture, the associated language, the country/region, the calendar used, and how to format dates and sort strings.

Applies to

See also