SpeechRecognizer.CompileConstraintsAsync Method

Definition

Asynchronously compile all constraints specified by the Constraints property.

public:
 virtual IAsyncOperation<SpeechRecognitionCompilationResult ^> ^ CompileConstraintsAsync() = CompileConstraintsAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<SpeechRecognitionCompilationResult> CompileConstraintsAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<SpeechRecognitionCompilationResult> CompileConstraintsAsync();
function compileConstraintsAsync()
Public Function CompileConstraintsAsync () As IAsyncOperation(Of SpeechRecognitionCompilationResult)

Returns

The result of the constraints compilation as a SpeechRecognitionCompilationResult object.

Attributes

Remarks

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

This method returns an error if:

  • SpeechRecognizerState is not Idle or Paused.
  • One or more constraints are specified when the recognition session is initialized, recognition is Paused, all constraints are removed, and recognition is resumed.
  • No constraints are specified when the recognition session is initialized, recognition is Paused, constraints are added, and recognition is resumed.

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.

Applies to

See also