SpeechRecognizer.Constraints Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the collection of constraint objects currently added to the SpeechRecognizer object.
public:
property IVector<ISpeechRecognitionConstraint ^> ^ Constraints { IVector<ISpeechRecognitionConstraint ^> ^ get(); };
IVector<ISpeechRecognitionConstraint> Constraints();
public IList<ISpeechRecognitionConstraint> Constraints { get; }
var iVector = speechRecognizer.constraints;
Public ReadOnly Property Constraints As IList(Of ISpeechRecognitionConstraint)
Property Value
A collection of ISpeechRecognitionConstraint objects.
Valid constraint objects include:
- SpeechRecognitionGrammarFileConstraint
- SpeechRecognitionListConstraint
- SpeechRecognitionTopicConstraint
- SpeechRecognitionVoiceCommandDefinitionConstraint
Each speech recognizer can have one constraint collection. Only these combinations of constraints are valid:
- A single SpeechRecognitionTopicConstraint (dictation or web search)
- Any combination of SpeechRecognitionListConstraint and/or SpeechRecognitionGrammarFileConstraint objects.
- For Windows 10 Fall Creators Update (10.0.16299.15) and newer, a single topic constraint can be combined with a list constraint
Important
Call the SpeechRecognizer.CompileConstraintsAsync method to compile the constraints before starting the recognition process.
Remarks
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.