SpeechRecognizedEventArgs Class

Returns data from the SpeechRecognized event.

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

Syntax

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

Remarks

An instance of SpeechRecognizedEventArgs is created when the SpeechRecognitionEngine.SpeechRecognized or Grammar.SpeechRecognized event is raised.

SpeechRecognizedEventArgs events are generated when one or more speech recognition hypothesis scores is high enough for a recognition engine to accept it.

Detailed information about a recognized phrase available through the Result property.

SpeechRecognizedEventArgs derives from RecognitionEventArgs.

Inheritance Hierarchy

System.Object
   System.EventArgs
     Microsoft.Speech.Recognition.RecognitionEventArgs
      Microsoft.Speech.Recognition.SpeechRecognizedEventArgs

Example

In the example below, a delegate is defined to use the instance of SpeechRecognizedEventArgs passed to the handler for SpeechRecognized events to display information about a recognized phrase.

// 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

SpeechRecognizedEventArgs Members
Microsoft.Speech.Recognition Namespace
RecognitionEventArgs Class
RecognitionResult Class