This sample demonstrates speech synthesis, also known as text-to-speech (TTS). It shows you how to read out content from a text box after configuring the synthesizer for a particular voice/language. When the app runs, it lists all voices installed on your device. With a voice selected, tap the Play button to have the text displayed in the TextBox read out to you in the voice you selected. You can type in different text and select other installed voices. This sample shows you how to:

  • List the installed voices on your device

  • Output spoken text using TTS

This sample uses the Windows.Phone.Speech.Synthesis Windows Phone Runtime API. For more info about the speech feature in Windows Phone 8, see Speech for Windows Phone 8.

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.

Notes

  • This sample can run on the Windows Phone 8 Emulator and on a Windows Phone 8 device.

  • When running the sample, make sure the audio out is working and the volume is high enough for you to hear the output.

  • If you are running the app in the emulator, you should see a total of 30 voices, two for each language (male and female). You may see a different number of languages installed on your Windows Phone 8 device.

  • To see the list of supported voices/languages available for speech synthesis on your phone, go to Settings | speech | Speech language. Voices not installed are displayed in this list with a download size displayed directly beneath them. You can install these languages by tapping the language and downloading it.

See also