SpeechDetectedEventArgs 类

定义

SpeechDetectedSpeechDetected 事件返回数据。Returns data from SpeechDetected or SpeechDetected events.

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

示例

下面的示例为SpeechRecognizer.SpeechDetectedSpeechRecognitionEngine.SpeechDetected事件创建了一个处理程序。The example below creates a handler for SpeechRecognizer.SpeechDetected or SpeechRecognitionEngine.SpeechDetected events. 每次检测到语音时, 处理程序都会初始化显示, 并显示状态信息, 包括音频位置。The handler initializes a display every time speech is detected and displays status information, including audio position.

_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);  
  };  

注解

SpeechDetected事件由和SpeechRecognitionEngine类引发。 SpeechRecognizerA SpeechDetected event is raised by the SpeechRecognizer and SpeechRecognitionEngine classes.

识别引擎可以将音频输入标识为人类语音时, 会生成SpeechDetected事件。SpeechDetected events are generated when a recognition engine can identify audio input as human speech.

SpeechDetectedEventArgs 派生自 EventArgsSpeechDetectedEventArgs derives from EventArgs.

属性

AudioPosition

获取语音在音频流中的检测位置。Gets the position in the audio stream where speech was detected.

方法

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)

适用于

另请参阅