Recognizing Speech Using the Dictation and Web Search Grammars

The SpeechRecognizerUI uses the online dictation grammar by default if no grammar is added to its grammar set. In the following example, a SpeechRecognizerUI is created and its speech recognizer’s RecognizeAsync method is called. The speech recognizer returns the recognized text in Result property of the SpeechRecognitionResult object, as shown:

SpeechRecognizerUI recognizerUI = new SpeechRecognizerUI();SpeechRecognitionResult result;try{    result = await recognizerUI.Recognizer.RecognizeAsync();}catch (Exception ex){    // Handle unable to recognize speech...    return;}string recognizedText = result.Text;...

You can explicitly add the dictation, or ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.