This topic has not yet been rated - Rate this topic

RecognitionEventArgs Class

Base class for event arguments objects passed to handlers of the speech recognition events.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
[SerializableAttribute]
public abstract class RecognitionEventArgs : EventArgs

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);
                };
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ