SpeechDetectedEventArgs Class
Returns data from the SpeechDetected event.
Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)
Syntax
'Declaration
Public Class SpeechDetectedEventArgs
Inherits EventArgs
public class SpeechDetectedEventArgs : EventArgs
public ref class SpeechDetectedEventArgs : public EventArgs
public class SpeechDetectedEventArgs extends EventArgs
public class SpeechDetectedEventArgs extends EventArgs
Remarks
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.
Inheritance Hierarchy
System.Object
System.EventArgs
Microsoft.Speech.Recognition.SpeechDetectedEventArgs
Example
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);
};
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
SpeechDetectedEventArgs Members
Microsoft.Speech.Recognition Namespace
AudioStatusChanged
SpeechDetected