RecognizerState RecognizerState RecognizerState RecognizerState Enum

定义

枚举识别器状态的值。Enumerates values of the recognizer's state.

public enum class RecognizerState
public enum RecognizerState
type RecognizerState = 
Public Enum RecognizerState
继承
RecognizerStateRecognizerStateRecognizerStateRecognizerState

字段

Listening Listening Listening Listening 1

识别引擎可接收和分析音频输入。The recognition engine is available to receive and analyze audio input.

Stopped Stopped Stopped Stopped 0

识别引擎不接收或分析音频输入。The recognition engine is not receiving or analyzing audio input.

示例

在下面的示例中,应用程序将显示在其实现中的处理程序的识别器的状态StateChanged事件。In the example below, an application displays the state of a recognizer in its implementation of a handler for the StateChanged event.


_recognizer.StateChanged +=  
    delegate(object sender, StateChangedEventArgs eventArgs) {  
        _recognizerStateLabel.Text = "Speech Recognizer State: " + eventArgs.RecognizerState.ToString();  
    };  

注解

RecognizerState 封装为客户端使用的默认语音识别引擎的运行状态SpeechRecognizer来访问 Windows 桌面语音识别技术服务。RecognizerState encapsulates the running state of the default speech recognition engine for clients using SpeechRecognizer to access the Windows Desktop Speech Recognition Technology service.

应用程序可以获取作为桌面识别引擎的当前状态RecognizerState通过查询对象State属性上的SpeechRecognizer实例。Applications can obtain the current state of the desktop recognition engine as a RecognizerState object by querying the State property on a SpeechRecognizer instance. 若要获取桌面识别引擎的状态发生更改后,应用程序可以查询RecognizerState的属性StateChangedEventArgs对象传递给处理程序StateChanged事件。To obtain the state of the desktop recognition engine after it changes, applications can query the RecognizerState property of the StateChangedEventArgs object passed to a handler for StateChanged events.

备注

SpeechRecognitionEngine 在进程中运行的实例和其运行状态是由应用程序的控制。SpeechRecognitionEngine instances run in-process and their running state is under the control of the application. 因此,SpeechRecognitionEngine不包含一个属性来返回RecognizerState对象。Therefore, SpeechRecognitionEngine does not contain a property to return a RecognizerState object.

桌面语音识别服务器的状态是只读的属性,并不能以编程方式控制。The state of a desktop speech recognition server is a read-only property and cannot be controlled programmatically. 用户可以更改共享的语音识别器的状态使用语音识别用户界面 (UI) 或通过语音识别成员的 Windows控制面板Users can change a shared speech recognizer's state using the Speech Recognition user interface (UI) or through the Speech Recognition member of the Windows Control Panel.

这两个睡眠语音识别 UI 中的设置对应于Listening状态。Both the On and Sleep settings in the Speech Recognition UI correspond to the Listening state. 关闭语音识别 UI 中的设置对应于已停止。The Off setting in the Speech Recognition UI corresponds to Stopped.

Enabled 是会影响共享的语音识别引擎来接收和处理语音输入的准备情况的其他属性。Enabled is the other property that affects the readiness of a shared speech recognition engine to receive and process speech input. 可以使用Enabled来控制共享的语音识别引擎的语法是否识别的活动。You can use Enabled to control whether or not a shared speech recognition engine's grammars are active for recognition. 但是,更改Enabled属性不起任何作用RecognizerState属性。However, changing the Enabled property has no effect on the RecognizerState property.

说明、 受支持的区域性和音频格式和识别引擎名称等信息封装在RecognizerInfo类型。Information such as the description, the supported culture and audio formats, and the recognition engine name is encapsulated in the RecognizerInfo type.

适用于

另请参阅