ISpeechRecognitionConstraint ISpeechRecognitionConstraint ISpeechRecognitionConstraint ISpeechRecognitionConstraint ISpeechRecognitionConstraint Interface


Represents a constraint for a SpeechRecognizer object.

public : interface ISpeechRecognitionConstraint
struct winrt::Windows::Media::SpeechRecognition::ISpeechRecognitionConstraint
public interface ISpeechRecognitionConstraint
Public Interface ISpeechRecognitionConstraint
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


Constraints, or grammars, define the spoken words and phrases that can be matched by the speech recognizer.

You can specify one of the pre-defined, web-service grammars (see SpeechRecognitionTopicConstraint ) or you can create your own custom grammar (see SpeechRecognitionGrammarFileConstraint, SpeechRecognitionListConstraint, and SpeechRecognitionVoiceCommandDefinitionConstraint ) that is installed with your app.

To use web-service constraints, speech input and dictation support must be enabled in Settings by turning on the "Get to know me" option in the Settings -> Privacy -> Speech, inking, and typing page. See "Recognize speech input" in Speech recognition.


IsEnabled IsEnabled IsEnabled IsEnabled IsEnabled

Gets or sets whether the constraint can be used by the SpeechRecognizer object to perform recognition.

Probability Probability Probability Probability Probability

Gets or sets the weighted value of the constraint.

Tag Tag Tag Tag Tag

Gets or sets a tag that can be useful for identifying the constraint.

Type Type Type Type Type

Gets the type of the constraint.

See also