SpeechDetectedEventArgs.AudioPosition SpeechDetectedEventArgs.AudioPosition SpeechDetectedEventArgs.AudioPosition SpeechDetectedEventArgs.AudioPosition Property

定義

音声が検出されたオーディオ ストリーム内の位置を取得します。Gets the position in the audio stream where speech was detected.

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

プロパティ値

認識エンジンの音声バッファー内で検出された語句の位置を返します。Returns the location of a detected phrase within a recognition engine's speech buffer.

次の例では、イベントSpeechRecognizer.SpeechDetectedまたSpeechRecognitionEngine.SpeechDetectedはイベントのハンドラーを作成します。The example below creates a handler for SpeechRecognizer.SpeechDetected or SpeechRecognitionEngine.SpeechDetected events. このハンドラーは、音声が検出されるたびにディスプレイを初期化し、オーディオ位置を含むステータス情報を表示します。The handler initializes a display each 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);  
  };  

適用対象

こちらもご覧ください