SpeechRecognizer.CompileConstraintsAsync SpeechRecognizer.CompileConstraintsAsync SpeechRecognizer.CompileConstraintsAsync SpeechRecognizer.CompileConstraintsAsync SpeechRecognizer.CompileConstraintsAsync Method

Definition

Asynchronously compile all constraints specified by the Constraints property.

public : IAsyncOperation<SpeechRecognitionCompilationResult> CompileConstraintsAsync()
IAsyncOperation<SpeechRecognitionCompilationResult> CompileConstraintsAsync() const;
public IAsyncOperation<SpeechRecognitionCompilationResult> CompileConstraintsAsync()
Public Function CompileConstraintsAsync() As IAsyncOperation(Of SpeechRecognitionCompilationResult)
Windows.Media.SpeechRecognition.SpeechRecognizer.compileConstraintsAsync().done( /* Your success and error handlers */ );

Returns

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.

See also