StateChangedEventArgs.RecognizerState 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得在 Windows 中的共用語音辨識引擎的目前狀態。
public:
property System::Speech::Recognition::RecognizerState RecognizerState { System::Speech::Recognition::RecognizerState get(); };
public System.Speech.Recognition.RecognizerState RecognizerState { get; }
member this.RecognizerState : System.Speech.Recognition.RecognizerState
Public ReadOnly Property RecognizerState As RecognizerState
屬性值
RecognizerState 執行個體,會表示共用的語音辨識引擎的狀態是 Listening
或 Stopped
。
範例
下列範例會根據實例所提供的 RecognizerState 狀態資訊,根據從傳遞至事件處理常式 StateChanged 之實例的 StateChangedEventArgs 屬性取得 RecognizerState 的狀態資訊,來更新顯示。
// Make sure that _recognizer and recognition start buttons are disabled if state is stopped.
// Re-enable the start button to allow manual re-enable if the speech recognizer is listening.
_recognizer.StateChanged +=
delegate(object sender, StateChangedEventArgs eventArgs)
{
_recognizerStateLabel.Text = "Speech Recognizer State: " + eventArgs.RecognizerState.ToString();
};