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)

Syntax

'Declaration
<SerializableAttribute> _
Public MustInherit Class RecognitionEventArgs
    Inherits EventArgs
[SerializableAttribute] 
public abstract class RecognitionEventArgs : EventArgs
[SerializableAttribute] 
public ref class RecognitionEventArgs abstract : public EventArgs
/** @attribute SerializableAttribute() */ 
public abstract class RecognitionEventArgs extends EventArgs
SerializableAttribute 
public abstract class RecognitionEventArgs extends EventArgs

Remarks

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.

Inheritance Hierarchy

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

Example

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

Thread Safety

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

Platforms

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

See Also

Reference

RecognitionEventArgs Members
Microsoft.Speech.Recognition Namespace
Grammar.SpeechRecognized Event
DtmfRecognitionEngine.DtmfHypothesized Event
DtmfRecognitionCompleted
DtmfRecognitionEngine.DtmfRecognitionRejected Event
DtmfRecognitionEngine.DtmfRecognized Event
Result
RecognitionResult
SpeechHypothesized
SpeechRecognitionCompleted
SpeechRecognitionRejected
SpeechRecognized