【问题标题】:Text to Speech (TTS) in background task in windows phone 8/8.1?windows phone 8/8.1后台任务中的文本到语音(TTS)?
【发布时间】:2014-10-03 11:32:09
【问题描述】:

我正在尝试在我的 Windows Phone 应用程序中实现后台任务。我需要在我的任务中实现 TTS,但我看不到它与 TTS 一起工作。下面是我的代码 sn-p。

    protected override void OnInvoke(ScheduledTask task)
    {
        //Some logic here
        SpeechSynthesizer synth = new SpeechSynthesizer();
        await synth.SpeakTextAsync("My message from back ground task!");    
    }


如果我只是用 toast 消息替换 TTS,我可以在设置的时间间隔内看到 toast 消息。我还在主应用程序中添加了 ID_CAP_SPEECH_RECOGNITION 功能。如何在我的后台计划任务中实现 TTS(我正在尝试实现周期性任务)。有人可以为我提供一个示例吗?

【问题讨论】:

    标签: windows-phone-8 windows-phone-8.1


    【解决方案1】:

    不支持。文本转语音仅适用于前台应用程序。 除了 toast 和 tile 通知之外,后台任务不能执行任何 UI。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多