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
属性值
指示共享语音识别引擎的状态是 Listening
还是 Stopped
的 RecognizerState 实例。
示例
以下示例根据实例提供 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();
};