Search code examples
c#windows-phone-8background-processspeech-synthesisspeechsynthesizer

How to play Windows Phone 8 SpeechSynthesizer during lock screen?


I have the following code to synthesize text to speech in a Windows Phone 8 application, however I can't seem to figure out how to have it continuously play during lock screen/screen off/or in the background. Does anyone have a suggestion or snippit of code on how to do this?

SpeechSynthesizer synth = new SpeechSynthesizer();
await synth.SpeakTextAsync("Text to read during screen off/lock screen/background");

Solution

  • It is just an suggestion, but why don't you simply allow you app to run under lock screen.

    In Application_Launching and Application_Activated events just add:

    PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;