RecognizerState Enumeration

RecognizerState Enumeration

 

Enumerates values of the recognizer's state.

Namespace:   System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

Public Enumeration RecognizerState

Member nameDescription
Listening

The recognition engine is available to receive and analyze audio input.

Stopped

The recognition engine is not receiving or analyzing audio input.

RecognizerState encapsulates the running state of the default speech recognition engine for clients using SpeechRecognizer to access the Windows Desktop Speech Recognition Technology service.

Applications can obtain the current state of the desktop recognition engine as a RecognizerState object by querying the State property on a SpeechRecognizer instance. 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.

System_CAPS_noteNote

SpeechRecognitionEngine instances run in-process and their running state is under the control of the application. 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. 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.

Both the On and Sleep settings in the Speech Recognition UI correspond to the Listening state. The Off setting in the Speech Recognition UI corresponds to Stopped.

Enabled is the other property that affects the readiness of a shared speech recognition engine to receive and process speech input. You can use Enabled to control whether or not a shared speech recognition engine's grammars are active for recognition. However, changing the Enabled property has no effect on the RecognizerState property.

Information such as the description, the supported culture and audio formats, and the recognition engine name is encapsulated in the RecognizerInfo type.

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

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft