AudioLevelUpdatedEventArgs 类

定义

SpeechRecognizerSpeechRecognitionEngine 类的 AudioLevelUpdated 事件提供数据。Provides data for the AudioLevelUpdated event of the SpeechRecognizer or the SpeechRecognitionEngine class.

public ref class AudioLevelUpdatedEventArgs : EventArgs
public class AudioLevelUpdatedEventArgs : EventArgs
type AudioLevelUpdatedEventArgs = class
    inherit EventArgs
Public Class AudioLevelUpdatedEventArgs
Inherits EventArgs
继承
AudioLevelUpdatedEventArgs

示例

下面的示例向SpeechRecognitionEngine对象添加一个事件处理程序。The following example adds an event handler to a SpeechRecognitionEngine object. 处理程序将新的音频级别输出到控制台。The handler outputs the new audio level to the console.

AudioLevelUpdatedEventArgs 派生自 EventArgsAudioLevelUpdatedEventArgs derives from EventArgs.

  
private SpeechRecognitionEngine sre;  
  
// Initialize the SpeechRecognitionEngine object.   
private void Initialize()  
{  
  sre = new SpeechRecognitionEngine();  
  
  // Add an event handler for the AudioLevelUpdated event.  
  sre.AudioLevelUpdated += new EventHandler<AudioLevelUpdatedEventArgs>(sre_AudioLevelUpdated);  
  
  // Add other initialization code here.  
}  
  
// Write the audio level to the console when the AudioLevelUpdated event is raised.  
void sre_AudioLevelUpdated(object sender, AudioLevelUpdatedEventArgs e)  
{  
  Console.WriteLine("The audio level is now: {0}.", e.AudioLevel);  
}  
  

注解

引发这些事件时, SpeechRecognitionEngine.AudioLevelUpdatedSpeechRecognizer.AudioLevelUpdated事件会将的AudioLevelUpdatedEventArgs实例传递给关联事件的处理程序。When they are raised, the SpeechRecognitionEngine.AudioLevelUpdated and SpeechRecognizer.AudioLevelUpdated events pass an instance of AudioLevelUpdatedEventArgs to the handler for the associated event.

当引发AudioLevelSpeechRecognizer.AudioLevelUpdated事件时, 属性将获取新的音频输入级别。 SpeechRecognitionEngine.AudioLevelUpdatedThe AudioLevel property gets the new level of audio input when the SpeechRecognitionEngine.AudioLevelUpdated or SpeechRecognizer.AudioLevelUpdated event is raised.

和类的AudioLevel属性提供语音识别引擎的音频输入的当前级别。SpeechRecognitionEngine SpeechRecognizerThe AudioLevel property of the SpeechRecognizer and SpeechRecognitionEngine classes provides the current level of the audio input to the speech recognition engine.

属性

AudioLevel

获取 AudioLevelUpdatedAudioLevelUpdated 事件引发后的新音频输入级别。Gets the new level of audio input after the AudioLevelUpdated or the AudioLevelUpdated event is raised.

方法

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)

适用于

另请参阅