-api-id | -api-type |
---|---|
T:Windows.Media.SpeechRecognition.SpeechRecognitionTopicConstraint |
winrt class |
A pre-defined grammar constraint (specifed by SpeechRecognitionScenario) provided through a web service.
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 or you can create your own custom grammar (see SpeechRecognitionGrammarFileConstraint, SpeechRecognitionListConstraint, and SpeechRecognitionVoiceCommandDefinitionConstraint) that is installed with your app.
CompileConstraintsAsync must always be called before RecognizeAsync or RecognizeWithUIAsync, even if no constraints are specified in the Constraints property.
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 Settings -> Privacy -> Speech, inking, and typing. For more detail on recognition constraints, see "Recognize speech input" in Speech recognition.
Note
Increase recognition accuracy during a lengthy dictation session by using a SpeechRecognitionListConstraint in conjunction with the SpeechRecognitionTopicConstraint. This lets you provide a set of domain-specific keywords that you think are likely to be used during dictation.
Windows.Media.SpeechRecognition, SpeechRecognitionConstraintType, ISpeechRecognitionConstraint, Speech interactions, Speech recognition and speech synthesis sample