Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SpeechRecognitionEngine.SpeechDetected Event

Event raised by recognition engine when speech is detected.

Namespace: System.Speech.Recognition
Assembly: System.Speech (in system.speech.dll)

public event EventHandler<SpeechDetectedEventArgs> SpeechDetected
/** @event */
public void add_SpeechDetected (EventHandler<SpeechDetectedEventArgs> value)

/** @event */
public void remove_SpeechDetected (EventHandler<SpeechDetectedEventArgs> value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

Windows Desktop Speech Technology based recognition engines have algorithms able to distinguish between background sound, random noise, and speech.

When the algorithm is satisified, a SpeechDetected is raised.

SpeechDetected events are always be followed by one or more SpeechHypothesized events, and finally by either a SpeechRecognized or SpeechRecognitionRejected event when the recognizer has finished processing the speech.

The position of the audio input to trigger a SpeechDetected event can be obtained by the SpeechDetected handler through the AudioPosition property of the SpeechDetectedEventArgs object passed to the handler.

The example below shows the subscription of an anonymous method as a handler for SpeechDetected. The handler displays the current state of the recognition engine, including the audio position of the speech that generated the event (Utils.DisplaySpeechDetected).

_recognizer.SpeechDetected +=
    delegate(object sender, SpeechDetectedEventArgs eventArgs) {
//Clear previous recognition information
_audioDeviceStatusLabel.Enabled = true;
_audioDeviceStatusLabel.Visible = true;
Utils.DisplayAudioInputFormat(_audioStateLabel, _recognizer);
Utils.DisplaySpeechDetected(_speechDetectedLabel, eventArgs.AudioPosition);

    };

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft