Starting Speech Recognition

To initiate speech recognition, your code should call StartContinuousRecognition after providing one or more grammars and one or more handlers for Recognition events, such as ContinuousRecognitionResultAvailable. The SpeechRecognizer will then attempt to match utterances from the user against the provided grammars, delivering SpeechRecognitionResult objects to the consuming code via the provided handlers on successful recognition, or raising errors through other events such as ContinuousRecognitionStatusChanged.

Instead of following an eventing model, call RecognizeAsync to listen for the next single phrase. Each call to RecognizeAsync attempts to match one utterance from a user to an enabled grammar in a speech recognizer’s grammar set. If any of the following occur, the asynchronous recognition operation will be finalized. The result of the asynchronous operation is a SpeechRecognitionResult object.

When recognition is started, either through StartContinuousRecognition or RecognizeAsync, the recognizer will automatically load all not-yet-loaded grammars. To avoid delays when starting recognition, it is usually advisable to request a grammar load operation before you need to begin Recognition. Preloading the grammars gives the advantage of less perceived delay to start a recognition operation.

You may instantiate only a single recognizer at one time. Subsequent attempts to instantiate another speech recognizer will result in HRESULT_FROM_WIN32(ERROR_NO_SYSTEM_RESOURCES).

Speech and Application Focus

Speech is a focus-sensitive input. When a title goes out of focus, the following occurs:

When the title regains focus, the following occurs: