RecognitionEventArgs RecognitionEventArgs RecognitionEventArgs RecognitionEventArgs Class

定義

音声認識イベントに関する情報を提供します。Provides information about speech recognition events.

public ref class RecognitionEventArgs abstract : EventArgs
[System.Serializable]
public abstract class RecognitionEventArgs : EventArgs
type RecognitionEventArgs = class
    inherit EventArgs
Public MustInherit Class RecognitionEventArgs
Inherits EventArgs
継承
RecognitionEventArgsRecognitionEventArgsRecognitionEventArgsRecognitionEventArgs
派生
属性

次の例のハンドラーをアタッチする、 SpeechHypothesizedSpeechRecognized、およびSpeechRecognitionRejected音声認識エンジンのイベント。The following example attaches a handler for the SpeechHypothesized, SpeechRecognized, and SpeechRecognitionRejected events of the speech recognizer. すべての 3 つのイベントのイベント引数の型から派生RecognitionEventArgsハンドラーでイベント データ パラメーターとして使用します。The event argument types for the three events all derive from RecognitionEventArgs, which is used as the event data parameter in the handler.


// Initialize the speech recognizer.  
private void Initialize(SpeechRecognitionEngine recognizer)  
{  
  // Attach handlers for the SpeechHypothesized, SpeechRecognitionRejected,  
  // and SpeechRecognized events.  
  recognizer.SpeechHypothesized +=  
    new EventHandler<SpeechHypothesizedEventArgs>(DisplayResult);  
  recognizer.SpeechRecognitionRejected +=  
    new EventHandler<SpeechRecognitionRejectedEventArgs>(DisplayResult);  
  recognizer.SpeechRecognized +=  
    new EventHandler<SpeechRecognizedEventArgs>(DisplayResult);  

  // Add other initialization code here.  
}  

// Handle the SpeechHypothesized, SpeechRecognitionRejected,  
// and SpeechRecognized events.  
private void DisplayResult(object sender, RecognitionEventArgs e)  
{  
  if (e is SpeechHypothesizedEventArgs)  
  {  
    Console.WriteLine("Speech hypothesized:");  
  }  
  else if (e is SpeechRecognitionRejectedEventArgs)  
  {  
    Console.WriteLine("Speech recognition rejected:");  
  }  
  else if (e is SpeechRecognizedEventArgs)  
  {  
    Console.WriteLine("Speech recognized:");  
  }  

  // Add code to handle the event.  
}  

注釈

Resultプロパティとして認識情報の取得、RecognitionResultオブジェクト。The Result property obtains the recognition information as a RecognitionResult object. 音声認識イベントに関する詳細については、次を参照してください。音声認識イベントを使用したします。For more information about speech recognition events, see Using Speech Recognition Events.

RecognitionEventArgsは次のクラスの基本。RecognitionEventArgs is the base for the following classes:

RecognitionEventArgs は、EventArgs から派生します。RecognitionEventArgs derives from EventArgs.

プロパティ

Result Result Result Result

音声認識イベントに関連付けられている認識結果データを取得します。Gets the recognition result data associated with the speech recognition event.

メソッド

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

適用対象

こちらもご覧ください