Provides data for the SpeechDetected event.
Inheritance Hierarchy
Namespace:
Microsoft.Speech.Recognition
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
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 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); }; |