語言

SpeechDetectedEventArgs.AudioPosition 屬性

定義

會取得音訊串流中語音被偵測到的位置。

public:
 property TimeSpan AudioPosition { TimeSpan get(); };
public TimeSpan AudioPosition { get; }
member this.AudioPosition : TimeSpan
Public ReadOnly Property AudioPosition As TimeSpan

屬性值

回傳識別引擎語音緩衝區中偵測到的片語位置。

範例

以下範例為 or 事件建立一個處理器SpeechRecognizer.SpeechDetectedSpeechRecognitionEngine.SpeechDetected。 處理器在每次偵測到語音時初始化顯示,並顯示狀態資訊,包括音訊位置。

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

適用於

另請參閱