Using text to speech in Windows Phone 8 and 8.1

You can use the Windows.Phone.Speech.Synthesis API to generate synthesized speech, also known as text-to-speech (TTS), in your Windows Phone 8 app. The following example creates an instance of a speech synthesizer and sets its language with the help of a LINQ query. The LINQ query searches through the VoiceInformation objects that describe each of the installed voices to find one whose language property has a value of “en-US”, which indicates the English language as spoken in US. The argument to the SpeechSynthesizerSetVoice(VoiceInformation) method specifies an index for the voices returned by the LINQ query. Find more details in this MSDN article

Note: To use TTS, you must set the ID_CAP_SPEECH_RECOGNITION capability in the app manifest.

If you are developing a Windows Phone 8.1 XAML app then use the following code instead.

Add a media element in your page and set its visibility to Collapsed if you don’t wish to display it.

Note: Add Microphone capability using Package.appmanifest.

Vivek Maskara

I am pursuing BTech in Software Engineering from Delhi Technological University. I develop apps, create websites and blog about my app experiences.

Read more:
How to create your first Windows Phone app
How to change the App name and Tile name of your Windows phone app
Data binding in Windows Phone app – One way binding
Close