This documentation is archived and is not being maintained.

RecognitionEventArgs Class

Represents the base class for event arguments objects for speech and DTMF recognition events.

Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)

[SerializableAttribute] 
public abstract class RecognitionEventArgs : EventArgs
/** @attribute SerializableAttribute() */ 
public abstract class RecognitionEventArgs extends EventArgs
SerializableAttribute 
public abstract class RecognitionEventArgs extends EventArgs

RecognitionEventArgs derives from System.EventArgs.

This class is the base class for the following objects:

  • DtmfRecognizedEventArgs and SpeechRecognizedEventArgs.

  • DtmfRecognitionRejectedEventArgs and SpeechRecognitionRejectedEventArgs.

  • DtmfRecognitionCompletedEventArgs and SpeechRecognitionCompletedEventArgs.

  • DtmfHypothesizedEventArgs and SpeechHypothesizedEventArgs.


System.Object
   System.EventArgs
    Microsoft.Speech.Recognition.RecognitionEventArgs
       Derived Classes

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);
                };

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Show: