SpeechRecognizer.StateChanged Event

Event generated when the Windows Desktop Speech Technology recognition engine running state changes.

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

public event EventHandler<StateChangedEventArgs> StateChanged
/** @event */
public void add_StateChanged (EventHandler<StateChangedEventArgs> value)

/** @event */
public void remove_StateChanged (EventHandler<StateChangedEventArgs> value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

Handlers ofStateChanged events can obtain the new state of the instance of SpeechRecognizer which generated the event through the RecognizerState instance returned by the P:System.Speech.Recognition.StateChangedEventArgs.RecognizerState property on the StateChangedEventArgs passed to the handler.

During stable periods, the running state of a SpeechRecognizer can be obtained through the RecognitionState instance returned by the State property.

System state can be changed programmatically through by setting Enabled property of a recognition engine (Enabled and Enabled) or by system configuration through the Speech member of the ControlPanel.

The example below updates a display based on the state information provided by and instance of RecognizerState obtained from the RecognizerState property of an instance of StateChangedEventArgs passed to a handler for a StateChanged.

//Make sure that _recognizer and recognition start buttons are disabled if state is stopped.
//Reenable the start button to allow manual reenable if start is listening
_recognizer.StateChanged +=
    delegate(object sender, StateChangedEventArgs eventArgs) {
_recognizerStateLabel.Text = "Speech Recognizer State: " + eventArgs.RecognizerState.ToString();

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0