How to Select a Speaking Voice for the Speech Synthesizer in Windows Phone 8?

The Speech Synthesizer in Windows Phone uses the default language that the user has selected in settings -> Speech App in Windows Phone. The Speech API in Windows Phone lets the developers to set the voice or gender of the voice to be used for the Speech Synthesizer. This blog post will explain in simple steps in how to set the speaking Voice for the Speech Synthesizer in Windows Phone.

How to Select a Speaking Voice for the Speech Synthesizer in Windows Phone 8?

The speaking voice from the InstalledVoices needs to identified as the first step and then assign it to the SpeechSynthesizer using its SetVoice method. Below is a simple function that picks the voice based on the language “de-DE” and gender = female and is used for the speech synthesizer.

async public Task SpeechSynthesizerExample()

{

SpeechSynthesizer speech = new SpeechSynthesizer();

VoiceInformation info = (from m in InstalledVoices.All

where m.Language == "de-DE"

&& m.Gender == VoiceGender.Female

select m).FirstOrDefault();

speech.SetVoice(info);

await speech.SpeakTextAsync("Welcome to DeveloperPublish.com");

}

No Responses

Leave a Reply