AudioStateChangedEventArgs Class

Provides data for the AudioStateChanged event of the SpeechRecognitionEngine class.

Inheritance Hierarchy


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


Public Class AudioStateChangedEventArgs _
    Inherits EventArgs
Dim instance As AudioStateChangedEventArgs
public class AudioStateChangedEventArgs : EventArgs


An instance of AudioStateChangedEventArgs is created when the SpeechRecognitionEngine object raises the AudioStateChanged event. To obtain the new state of audio input, access the AudioState property in the handler for the event.

You can obtain the current state of the audio input to the SpeechRecognitionEngine at any time using the AudioState property.


The following example demonstrates an event handler for handling the changing audio state of a speech recognition engine.

private SpeechRecognitionEngine sre;

// Initialize the SpeechRecognitionEngine object. 
private void Initialize()
  sre = new SpeechRecognitionEngine();

  // Add a handler for the AudioStateChanged event.
  sre.AudioStateChanged += new EventHandler<AudioStateChangedEventArgs>(sre_AudioStateChanged);

  // Add other initialization code here.

// Handle the AudioStateChanged event. 
void sre_AudioStateChanged(object sender, AudioStateChangedEventArgs e)
  AudioState newState = e.AudioState;

  // Handle event here.

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


AudioStateChangedEventArgs Members

Microsoft.Speech.Recognition Namespace