This topic has not yet been rated - Rate this topic

RecognizeMode Enumeration

Enumerates values of the recognition mode.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public enum RecognizeMode
Member name Description
Single Specifies that recognition terminates after completion.
Multiple Specifies that recognition does not terminate after completion.

This enumeration is used as an argument to RecognizeAsync(RecognizeMode)

In the following example show the implementation of a start/stop button for a application with a graphical user interface using SpeechRecognitionEngine. Depending on the state of the application, when the button is clicked RecognizeAsync(RecognizeMode) is called with either Single or Multiple.

private void _startRecogButton_Click(object sender, EventArgs eventArgs) {
    if (_startRecogButton.Text == "Start Speech Recognition") { //Toggle Speech Recogniztion on
        _startRecogButton.Text = "Stop Speech Recognition";
        if (_useMultiple) {
            _recognitionEngine.RecognizeAsync(RecognizeMode.Multiple);
        } else {
            _recognitionEngine.RecognizeAsync(RecognizeMode.Single);
        }
    } else {                                                      //Toggle Speech Recognition off
        _startRecogButton.Text = "Start Speech Recognition";
        if (_friendlyStop) {
            _recognitionEngine.RecognizeAsyncStop(); //Stop after current phrase is finished.
        } else {
            _recognitionEngine.RecognizeAsyncCancel(); //Stop before current phrase is finished.
        }

    }
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ