Windows Dev Center

SpeechRecognitionListConstraint class

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

A constraint for a SpeechRecognizer object based on a list of words or phrases. When initialized, this object is added to the Constraints collection.

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 (SpeechRecognitionTopicConstraint) or you can create a custom grammar, described here, that is installed with your app (speech recognition using a custom constraint is performed on the device).

  • Programmatic list constraints (SpeechRecognitionListConstraint) provide a lightweight approach to creating simple grammars using a list of words or phrases. A list constraint works well for recognizing short, distinct phrases. Explicitly specifying all words in a grammar also improves recognition accuracy, as the speech recognition engine must only process speech to confirm a match. The list can also be programmatically updated.
  • A Speech Recognition Grammar Specification (SRGS) grammar (SpeechRecognitionGrammarFileConstraint) is a static document that, unlike a programmatic list constraint, uses the XML format defined by the SRGS Version 1.0. An SRGS grammar provides the greatest control over the speech recognition experience by letting you capture multiple semantic meanings in a single recognition.

Syntax


var speechRecognitionListConstraint = new Windows.Media.SpeechRecognition.SpeechRecognitionListConstraint(iIterable(String));
var speechRecognitionListConstraint = new Windows.Media.SpeechRecognition.SpeechRecognitionListConstraint(iIterable(String));

Members

The SpeechRecognitionListConstraint class has these types of members:

Constructors

The SpeechRecognitionListConstraint class has these constructors.

ConstructorDescription
SpeechRecognitionListConstraint(IIterable(String)) Creates an instance of the SpeechRecognitionListConstraint class from an array of words or phrases.
SpeechRecognitionListConstraint(IIterable(String),String) Creates an instance of the SpeechRecognitionListConstraint class from an array of words or phrases and a tag.

 

Properties

The SpeechRecognitionListConstraint class has these properties.

PropertyAccess typeDescription

Commands

Read-onlyGets the array of words or phrases that make up the constraint.

IsEnabled

Read/writeGets or sets whether the constraint can be used by the speech recognizer to perform recognition.

Probability

Read/writeGets or sets the weighted value of the constraint.

Tag

Read/writeGets or sets a tag that can be useful for identifying the constraint.

Type

Read-onlyGets the type of the constraint.

 

Remarks

CompileConstraintsAsync must always be called before RecognizeAsync or RecognizeWithUIAsync, even if no constraints are specified in the Constraints property.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Media.SpeechRecognition
Windows::Media::SpeechRecognition [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Media.SpeechRecognition
Windows::Media::SpeechRecognition [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06030000)]

See also

Object
Developers
Windows.Media.SpeechRecognition
ISpeechRecognitionConstraint
Responding to speech interactions (HTML)
Responding to speech interactions (XAML)
Designers
Speech design guidelines

 

 

Show:
© 2015 Microsoft