5 out of 10 rated this helpful - Rate this topic

Speech recognition for Windows Phone 8

April 14, 2014

Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 only

Speech recognition can be a natural, efficient, and accurate way for users to interact with apps in Windows Phone 8. To support speech recognition, Windows Phone 8 includes a speech runtime, recognition APIs for programming the runtime, ready-to-use grammars for dictation and web search, and a GUI that helps users discover and use speech recognition features.

NoteNote:

To use speech recognition, you must set the ID_CAP_SPEECH_RECOGNITION, ID_CAP_MICROPHONE, and ID_CAP_NETWORKING capabilities in the app manifest. If you do not set these capabilities, your app might not work correctly. For more info, see App capabilities and hardware requirements for Windows Phone 8.

The quickest and easiest way to enable your app for speech recognition is to use the predefined dictation grammar included with Windows Phone 8. The dictation grammar will recognize most words and short phrases in a language, and is activated by default when a speech recognizer object is instantiated. Using the predefined dictation grammar, you can enable speech recognition with just a few lines of code, as in the following example:

private async void ButtonSR_Click(object sender, RoutedEventArgs e)
{
  // Create an instance of SpeechRecognizerUI.
  this.recoWithUI = new SpeechRecognizerUI();

  // Start recognition (load the dictation grammar by default).
  SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();

  // Do something with the recognition result.
  MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
}

There are many speech recognition errors and exceptions that you might encounter when working with the feature, including an error that occurs when the speech privacy policy is not accepted. For more info about these errors and exceptions, see Handling errors in speech apps for Windows Phone 8.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.