Dela via


ISpeechRecognitionConstraint Interface

Definition

Represents a constraint for a SpeechRecognizer object.

public interface class ISpeechRecognitionConstraint
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2041321000, 19816, 17348, 137, 17, 64, 220, 65, 1, 181, 91)]
struct ISpeechRecognitionConstraint
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(2041321000, 19816, 17348, 137, 17, 64, 220, 65, 1, 181, 91)]
public interface ISpeechRecognitionConstraint
Public Interface ISpeechRecognitionConstraint
Derived
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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 (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.

Properties

IsEnabled

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

Probability

Gets or sets the weighted value of the constraint.

Tag

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

Type

Gets the type of the constraint.

Applies to

See also