SpeechRecognitionTopicConstraint SpeechRecognitionTopicConstraint SpeechRecognitionTopicConstraint SpeechRecognitionTopicConstraint SpeechRecognitionTopicConstraint Class

Definition

A pre-defined grammar constraint (specifed by SpeechRecognitionScenario ) provided through a web service.

public : sealed class SpeechRecognitionTopicConstraint : ISpeechRecognitionConstraint
struct winrt::Windows::Media::SpeechRecognition::SpeechRecognitionTopicConstraint : ISpeechRecognitionConstraint
public sealed class SpeechRecognitionTopicConstraint : ISpeechRecognitionConstraint
Public NotInheritable Class SpeechRecognitionTopicConstraint Implements ISpeechRecognitionConstraint
var speechRecognitionTopicConstraint = new speechRecognitionTopicConstraint(scenario, topicHint);
Attributes

Windows 10 requirements

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

Remarks

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.

Constructors

SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String)

Creates an instance of the SpeechRecognitionTopicConstraint class by using a pre-defined scenario type and context.

SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String) SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String)

Creates an instance of the SpeechRecognitionTopicConstraint class by using a pre-defined scenario type, context, and an identifier.

Properties

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.

Scenario Scenario Scenario Scenario Scenario

Gets the predefined scenario type for the constraint.

Tag Tag Tag Tag Tag

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

TopicHint TopicHint TopicHint TopicHint TopicHint

Gets the topic hint for the constraint.

Type Type Type Type Type

Gets the type of the constraint.

See also