TTS打破背景模式

时间:2017-10-25 09:38:30

标签: javascript cordova text-to-speech

我在这个插件中使用TTS:https://github.com/vilic/cordova-plugin-tts

我将它与此背景模式插件结合使用: https://github.com/katzer/cordova-plugin-background-mode

问题是,如果我启动TTS(即使我给出一个空字符串),背景模式将被破坏并且不再工作,其他功能正在停止。语音本身在后台模式下运行。没有启动TTS一切都很好。

这是第二次。当我第一次运行TTS时,后台模式正在运行。它是否与我第二次调用TTS然后存在两个它的事实有关?

TTS.speak({
        text: text,
        locale: 'de-DE',
        rate: 1.5
        }, function () {

            // run function which is stopping (if I go to Background) after the second TTS

             }, function (reason) {
        console.log(reason);
    });

可能是什么原因?有办法解决吗?

1 个答案:

答案 0 :(得分:0)

现在我尝试了另一种TTS Cordova插件:

https://github.com/GruppoMeta/cordova-plugin-adv-tts

这没有问题。