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.