Zdieľať cez


AudioStateChangedEventArgs Class

Definition

Provides data for the AudioStateChanged event of the SpeechRecognizer or the SpeechRecognitionEngine class.

public ref class AudioStateChangedEventArgs : EventArgs
public class AudioStateChangedEventArgs : EventArgs
type AudioStateChangedEventArgs = class
    inherit EventArgs
Public Class AudioStateChangedEventArgs
Inherits EventArgs
Inheritance
AudioStateChangedEventArgs

Examples

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.  
}  

Remarks

The AudioState property gets a new instance of the AudioState enumeration when a SpeechRecognitionEngine.AudioStateChanged or a SpeechRecognizer.AudioStateChanged event is raised.

You can obtain the current state of the audio input using the AudioState property of the SpeechRecognizer or SpeechRecognitionEngine classes.

Properties

AudioState

Gets the new state of audio input to the recognizer.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also