1 out of 5 rated this helpful - Rate this topic

SpeechRecognizer Class

Provides access to the default shared speech recognition service available on the Windows Desktop.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public class SpeechRecognizer : IDisposable

Applications use SpeechRecognizer to implement a Windows Desktop Speech Technology client, using a system's default shared Technology as an out of process server.

Use of the SpeechRecognizer object is recommended for applications needing to process voice input received from through a desktop's standard audio input channels, such as a microphone.

Applications using SpeechRecognizer effectively do so through creating event handlers to receive audio recognition results, by controlling the grammars used, and by enabling or disabling recognition operations.

To support this, SpeechRecognizer provides programmatic control over:

The configuration of the Windows Desktop Speech Technology on a system is managed through the Audio tab of the SpeechProperties member of the ControlPanel. This interface is used to select language, audio input device, and the default desktop speech recognition engine.

An instance of SpeechRecognizer makes use of the current configuration of the Windows Desktop Speech Technology on a system. If that configuration is changed while the application is running, (for instance if the recognition engine is disabled, or the language changed), that change will affect the use of SpeechRecognizer.

Applications requiring greater control over the Windows Desktop Speech Technology, or that require an in process recognition engine SpeechRecognitionEngine.

SpeechRecognizer implements [IDispose].

Under Windows XP Professional with Service Pack 2 (SP2), applications are limited to a single instance of SpeechRecognizer.

The example below shows the creation, initialization, and of a SpeechRecognizer object.

// Initializes the SystemRecognizer and loads sample grammars on form load.
private void Exerciser_Load(object sender, EventArgs eventArgs) {

// Initialize the DesktopRecognizer and event handlers.

_recognizer = new SpeechRecognizer();
// Disable recognition of grammars.
_recognizer.Enabled = false;

SetupEventHandlers();

LoadInitialGrammars();
_recognizer.PauseRecognizerOnRecognition = true;
}
System.Object
  System.Speech.Recognition.SpeechRecognizer
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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