You can use the classes in the Windows.Phone.Speech.Synthesis namespace to generate synthesized speech, also known as text-to-speech (TTS), in your app. For example, your app could use a synthesized text-to-speech (TTS) voice to prompt users for input, to read the contents of a message, to present search results, and more. Note: to use TTS, you must set the ID_CAP_SPEECH_RECOGNITION capability in the app manifest. If you don’t set this capability, your app might not work correctly

This basic text-to-speech sample shows and hides an ellipse shape when a button is tapped. While the ellipse is being shown or hidden, a text-to-speech voice speaks "Showing the Ellipse" or "Hiding the Ellipse" by using the asynchronous SpeechSynthesizer.SpeakTextAsync method, which reads the content of a plain-text string.

Build the sample

  1. Start Visual Studio Express 2012 for Windows Phone and select File > Open > Project/Solution.

  2. Go to the directory in which you unzipped the sample. Double-click the Visual Studio Express 2012 for Windows Phone solution (.sln) file.

  3. Use Build > Rebuild Solution to build the sample.

Run the sample

  • To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.

See also