This documentation is archived and is not being maintained.

SpeechDetectedEventArgs Class

Returns data from the SpeechDetected event.

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

public class SpeechDetectedEventArgs : EventArgs
public class SpeechDetectedEventArgs extends EventArgs
public class SpeechDetectedEventArgs extends EventArgs

An instance of SpeechDetectedEventArgs is created when the SpeechRecognitionEngine. SpeechDetected event is raised.

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

SpeechDetectedEventArgs derives from System.EventArgs.


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.

_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.DisplayAudioInputStatus(_audioDeviceStatusLabel, _recognizer.AudioStatus);
        Utils.DisplaySpeechDetected(_speechDetectedLabel, eventArgs.AudioPosition);

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