SpeechRecognitionTopicConstraint
SpeechRecognitionTopicConstraint
SpeechRecognitionTopicConstraint
SpeechRecognitionTopicConstraint
Class
Definition
A pre-defined grammar constraint (specifed by SpeechRecognitionScenario ) provided through a web service.
public : sealed class SpeechRecognitionTopicConstraint : ISpeechRecognitionConstraint, ISpeechRecognitionTopicConstraintpublic sealed class SpeechRecognitionTopicConstraint : ISpeechRecognitionConstraint, ISpeechRecognitionTopicConstraintPublic NotInheritable Class SpeechRecognitionTopicConstraint Implements ISpeechRecognitionConstraint, ISpeechRecognitionTopicConstraint// You can use this class in JavaScript.
- Attributes
| 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 the Settings -> Privacy -> Speech, inking, and typing page. See "Recognize speech input" in Speech recognition.
Constructors
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.
public : SpeechRecognitionTopicConstraint(SpeechRecognitionScenario scenario, PlatForm::String topicHint)public SpeechRecognitionTopicConstraint(SpeechRecognitionScenario scenario, String topicHint)Public Sub New(scenario As SpeechRecognitionScenario, topicHint As String)// You can use this method in JavaScript.
- scenario
- SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario
A predefined scenario type.
- topicHint
- PlatForm::String String String String
A subject, or context hint, used to optimize recognition.
- See Also
-
SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String)SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String)SpeechRecognitionTopicConstraint(SpeechRecognitionScenario, String, String)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.
public : SpeechRecognitionTopicConstraint(SpeechRecognitionScenario scenario, PlatForm::String topicHint, PlatForm::String tag)public SpeechRecognitionTopicConstraint(SpeechRecognitionScenario scenario, String topicHint, String tag)Public Sub New(scenario As SpeechRecognitionScenario, topicHint As String, tag As String)// You can use this method in JavaScript.
- scenario
- SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario
A predefined scenario type.
- topicHint
- PlatForm::String String String String
A subject, or context hint, used to optimize recognition.
- tag
- PlatForm::String String String String
Identifier for the constraint.
Properties
IsEnabled IsEnabled IsEnabled IsEnabled
Gets or sets whether the constraint can be used by the SpeechRecognizer object to perform recognition.
public : PlatForm::Boolean IsEnabled { get; set; }public bool IsEnabled { get; set; }Public ReadWrite Property IsEnabled As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
if a speech recognizer can perform recognition using the constraint; otherwise .
- See Also
Probability Probability Probability Probability
Gets or sets the weighted value of the constraint.
public : SpeechRecognitionConstraintProbability Probability { get; set; }public SpeechRecognitionConstraintProbability Probability { get; set; }Public ReadWrite Property Probability As SpeechRecognitionConstraintProbability// You can use this property in JavaScript.
- Value
- SpeechRecognitionConstraintProbability SpeechRecognitionConstraintProbability SpeechRecognitionConstraintProbability SpeechRecognitionConstraintProbability
An enumeration that indicates the weighted value of the constraint.
- See Also
Scenario Scenario Scenario Scenario
Gets the predefined scenario type for the constraint.
public : SpeechRecognitionScenario Scenario { get; }public SpeechRecognitionScenario Scenario { get; }Public ReadOnly Property Scenario As SpeechRecognitionScenario// You can use this property in JavaScript.
- Value
- SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario SpeechRecognitionScenario
The predefined scenario type for the constraint.
- See Also
Tag Tag Tag Tag
Gets or sets a tag that can be useful for identifying the constraint.
public : PlatForm::String Tag { get; set; }public string Tag { get; set; }Public ReadWrite Property Tag As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
A string representing the tag.
- See Also
TopicHint TopicHint TopicHint TopicHint
Gets the topic hint for the constraint.
public : PlatForm::String TopicHint { get; }public string TopicHint { get; }Public ReadOnly Property TopicHint As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The topic hint for the constraint.
- See Also
Type Type Type Type
Gets the type of the constraint.
public : SpeechRecognitionConstraintType Type { get; }public SpeechRecognitionConstraintType Type { get; }Public ReadOnly Property Type As SpeechRecognitionConstraintType// You can use this property in JavaScript.
- Value
- SpeechRecognitionConstraintType SpeechRecognitionConstraintType SpeechRecognitionConstraintType SpeechRecognitionConstraintType
An enumeration that indicates the type of the constraint. Always returns Topic for SpeechRecognitionTopicConstraint.
- See Also