StateChangedEventArgs.RecognizerState 属性

定义

获取 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

属性值

指示共享语音识别引擎的状态是 Listening 还是 StoppedRecognizerState 实例。

示例

以下示例根据实例提供 RecognizerState 的状态信息更新显示,该状态信息是从 RecognizerState 传递给事件的处理程序的 StateChangedEventArgs 实例的 属性获取的 StateChanged

// 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();  
};  

适用于