RecognizerInfo.Id RecognizerInfo.Id RecognizerInfo.Id RecognizerInfo.Id Property

定義

SpeechRecognizer インスタンスまたは SpeechRecognitionEngine インスタンスの識別子を取得します。Gets the identifier of a SpeechRecognizer or SpeechRecognitionEngine instance.

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

プロパティ値

特定の SpeechRecognizer または SpeechRecognitionEngine インスタンスの識別子を返します。Returns the identifier for a specific SpeechRecognizer or SpeechRecognitionEngine instance.

次の例では、実装内のすべての情報を表示するボタンのクリック、RecognizerInfoインスタンス。The following example implements a button click that displays all the information in a RecognizerInfo instance. この例では、Id認識エンジンの構成の識別子の文字列を取得するプロパティで表示、MessageBoxします。The example uses the Id property to obtain the identifier string of a recognition engine configuration, and then displays it in a 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));  
}  

注釈

によって返される識別子、Idプロパティは、Windows レジストリ内で認識エンジンのトークンの名前と同じです。The identifier returned by the Id property is the same as the token name of the recognition engine in the Windows registry.

適用対象

こちらもご覧ください