RecognizerInfo.Description 属性

定义

获取 SpeechRecognizerSpeechRecognitionEngine 实例的说明。

public:
 property System::String ^ Description { System::String ^ get(); };
public string Description { get; }
member this.Description : string
Public ReadOnly Property Description As String

属性值

返回描述特定 SpeechRecognizerSpeechRecognitionEngine 实例的配置的 string

示例

下面的示例实现了一个按钮单击,该按钮单击显示 实例中的所有 RecognizerInfo 信息。 该示例使用 Description 属性获取语音识别引擎配置的说明,然后在 中 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));  
}  

适用于

另请参阅