AudioStateChangedEventArgs 类

定义

SpeechRecognizerSpeechRecognitionEngine 类的 AudioStateChanged 事件提供数据。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
继承
AudioStateChangedEventArgs

示例

下面的示例演示了一个事件处理程序, 用于处理语音识别引擎的变化音频状态。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.  
}  
  

注解

AudioState引发SpeechRecognitionEngine.AudioStateChangedSpeechRecognizer.AudioStateChanged事件时, 属性将AudioState获取枚举的新实例。The AudioState property gets a new instance of the AudioState enumeration when a SpeechRecognitionEngine.AudioStateChanged or a SpeechRecognizer.AudioStateChanged event is raised.

您可以使用AudioState SpeechRecognizerSpeechRecognitionEngine类的属性获取音频输入的当前状态。You can obtain the current state of the audio input using the AudioState property of the SpeechRecognizer or SpeechRecognitionEngine classes.

属性

AudioState

获取识别器的新音频输入状态。Gets the new state of audio input to the recognizer.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅