SpeechRecognizer SpeechRecognizer SpeechRecognizer SpeechRecognizer SpeechRecognizer Class


Enables speech recognition with either a default or a custom graphical user interface (GUI).

public : sealed class SpeechRecognizer : IClosable, ISpeechRecognizer, ISpeechRecognizer2
struct winrt::Windows::Media::SpeechRecognition::SpeechRecognizer : IClosable, ISpeechRecognizer, ISpeechRecognizer2
public sealed class SpeechRecognizer : IDisposable, ISpeechRecognizer, ISpeechRecognizer2
Public NotInheritable Class SpeechRecognizer Implements IDisposable, ISpeechRecognizer, ISpeechRecognizer2
var speechRecognizer = new speechRecognizer();
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


CompileConstraintsAsync must always be called before RecognizeAsync or RecognizeWithUIAsync, even if no constraints are specified in the Constraints property.


SpeechRecognizer() SpeechRecognizer() SpeechRecognizer() SpeechRecognizer() SpeechRecognizer()

Creates a new instance of the SpeechRecognizer class.

SpeechRecognizer(Language) SpeechRecognizer(Language) SpeechRecognizer(Language) SpeechRecognizer(Language) SpeechRecognizer(Language)

Creates a new instance of the SpeechRecognizer class with a language specifier.


Constraints Constraints Constraints Constraints Constraints

Gets the collection of constraint objects that are associated with the SpeechRecognizer object.

ContinuousRecognitionSession ContinuousRecognitionSession ContinuousRecognitionSession ContinuousRecognitionSession ContinuousRecognitionSession

Gets the continuous recognition (dictation) session object (SpeechContinuousRecognitionSession ) associated with this SpeechRecognizer.

CurrentLanguage CurrentLanguage CurrentLanguage CurrentLanguage CurrentLanguage

Gets the language used for speech recognition.

State State State State State

Gets the state of the speech recognizer.

SupportedGrammarLanguages SupportedGrammarLanguages SupportedGrammarLanguages SupportedGrammarLanguages SupportedGrammarLanguages

Gets the collection of languages supported by the custom grammars of the SpeechRecognitionGrammarFileConstraint and SpeechRecognitionListConstraint objects specified in the Constraints property.

SupportedTopicLanguages SupportedTopicLanguages SupportedTopicLanguages SupportedTopicLanguages SupportedTopicLanguages

Gets the collection of languages supported by the pre-defined, web-service grammars of the SpeechRecognitionTopicConstraint objects specified in the Constraints property.

SystemSpeechLanguage SystemSpeechLanguage SystemSpeechLanguage SystemSpeechLanguage SystemSpeechLanguage

Gets the speech language of the device specified in Settings > Time & Language > Speech.

Timeouts Timeouts Timeouts Timeouts Timeouts

Gets how long a speech recognizer ignores silence or unrecognizable sounds (babble) and continues listening for speech input.

UIOptions UIOptions UIOptions UIOptions UIOptions

Gets the UI settings for the RecognizeWithUIAsync method.


Close() Close() Close() Close() Close()

Disposes the speech recognizer by freeing, releasing, or resetting allocated resources.

CompileConstraintsAsync() CompileConstraintsAsync() CompileConstraintsAsync() CompileConstraintsAsync() CompileConstraintsAsync()

Asynchronously compile all constraints specified by the Constraints property.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RecognizeAsync() RecognizeAsync() RecognizeAsync() RecognizeAsync() RecognizeAsync()

Begins a speech recognition session for a SpeechRecognizer object.

RecognizeWithUIAsync() RecognizeWithUIAsync() RecognizeWithUIAsync() RecognizeWithUIAsync() RecognizeWithUIAsync()

Asynchronously starts a speech recognition session that includes additional UI mechanisms, including prompts, examples, text-to-speech (TTS), and confirmations.

StopRecognitionAsync() StopRecognitionAsync() StopRecognitionAsync() StopRecognitionAsync() StopRecognitionAsync()

Asynchronously ends the speech recognition session.

TrySetSystemSpeechLanguageAsync(Language) TrySetSystemSpeechLanguageAsync(Language) TrySetSystemSpeechLanguageAsync(Language) TrySetSystemSpeechLanguageAsync(Language) TrySetSystemSpeechLanguageAsync(Language)

Asynchronously attempts to set the system language used for speech recognition on an IoT device.


This method is available only in Embedded mode.


HypothesisGenerated HypothesisGenerated HypothesisGenerated HypothesisGenerated HypothesisGenerated

Occurs during an ongoing dictation session when a recognition result fragment is returned by the speech recognizer.

RecognitionQualityDegrading RecognitionQualityDegrading RecognitionQualityDegrading RecognitionQualityDegrading RecognitionQualityDegrading

This event is raised when an audio problem is detected that might affect recognition accuracy.

StateChanged StateChanged StateChanged StateChanged StateChanged

This event is raised when a change occurs to the State property during audio capture.

See Also