RecognitionEventArgs Class
Base class for event arguments objects passed to handlers of the speech recognition events.
Assembly: System.Speech (in System.Speech.dll)
RecognitionEventArgs derives from [System.EventArgs].
Event handlers obtain detailed information about a speech recognition through the Result property of each derived class.
This class is the base class for:
-
SpeechRecognizedEventArgs , which is passed to the SpeechRecognized handler when an engine determines it has recognized a phrase.
-
SpeechRecognitionRejected , which is passed to the SpeechRecognitionRejected handler when an engine cannot recognize a phrase.
-
SpeechHypothesizedEventArgs , which is passed to the SpeechHypothesized() event handler when an engine has developed a tentative recognition hypothesis for a phrase.
In the example below, delegates are defined to handle SpeechHypothesized, SpeechRecognized and SpeechRecognitionRejected events which pass instances of the appropriate derived event argument class to a display routine accepting instances of RecognitionEventArgs.
// Handles the SpeechHypothesized event and displays the hypothesized result.
_recognizer.SpeechHypothesized +=
delegate(object sender, SpeechHypothesizedEventArgs eventArgs)
{
DisplayResult(eventArgs);
};
// Handles the SpeechRecognitionRejected event and displays the rejected result.
_recognizer.SpeechRecognitionRejected +=
delegate(object sender, SpeechRecognitionRejectedEventArgs eventArgs)
{
DisplayResult(eventArgs);
};
// Handles the SpeechRecognized event and displays the recognized result.
_recognizer.SpeechRecognized +=
delegate(object sender, SpeechRecognizedEventArgs eventArgs)
{
DisplayResult(eventArgs);
};
System.EventArgs
System.Speech.Recognition.RecognitionEventArgs
System.Speech.Recognition.SpeechHypothesizedEventArgs
System.Speech.Recognition.SpeechRecognitionRejectedEventArgs
System.Speech.Recognition.SpeechRecognizedEventArgs
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.