SpeechDetectedEventArgs Class

Microsoft Speech Platform SDK 11

Collapse imageExpand ImageCopy imageCopyHover image

Provides data for the SpeechDetected event.

Inheritance Hierarchy

System..::..Object
  System..::..EventArgs
    Microsoft.Speech.Recognition..::..SpeechDetectedEventArgs

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

Syntax

Visual Basic (Declaration)
Public Class SpeechDetectedEventArgs _
	Inherits EventArgs
Visual Basic (Usage)
Dim instance As SpeechDetectedEventArgs
C#
public class SpeechDetectedEventArgs : EventArgs

Remarks

An instance of SpeechDetectedEventArgs is created when the SpeechRecognitionEngine object raises the SpeechDetected event. To obtain the location in the audio stream where the event was raised, access the AudioPosition property in the handler for the event.

SpeechDetected events are generated when a recognition engine can identify audio input as human speech.

SpeechDetectedEventArgs derives from EventArgs.

Examples

In the example below, a handler is created for SpeechDetected events which initializes a display every time speech is detected and displays status information, including audio position.

 Copy imageCopy Code
_recognizer.SpeechDetected +=
  delegate(object sender, SpeechDetectedEventArgs eventArgs) 
  {

    // Clear previous recognition information.
    _audioDeviceStatusLabel.Enabled = true;
    _audioDeviceStatusLabel.Visible = true;
    Utils.DisplayAudioInputFormat(_audioStateLabel, _recognizer);
    Utils.DisplayRecognizerState(_recognizerStateLabel, _recognizer.State);
    Utils.DisplaySpeechDetected(_speechDetectedLabel, eventArgs.AudioPosition);
  };

Thread Safety

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

See Also