当webapp被编译成带有phonegap的android应用程序时,为什么TTS不能工作呢?
我试图让TTS使用ResponsiveVoice.js并通过phonegap (https://build.phonegap.com/apps/2204237/builds)编译我的安卓应用程序。
在测试过的手机和台式机上的浏览器中,它可以正常工作,但是一旦编译并转换成apk,它就停止工作了。
在单击响应按钮时,我使用基本的jQuery调用来启用ResponsiveVoice.js。
按钮:
<section>
<a rel="external" href="#" id="zero" type="button" value="Play"></a>
<span>0</span>
</section>jQuery:
zero.onclick = function() {
responsiveVoice.speak('Zero' + ' ' + $('#dropdown').val() + ' ' + $('#name').val());
};完整代码:https://github.com/hakarune/reading-pounds
测试页面:https://rawgit.com/hakarune/reading-pounds/master/index.html
有什么更好的方法来解决这个问题吗?我偶然发现了ResponsiveVoice.js,它很容易使用.
发布于 2017-01-25 15:01:08
如果您尝试调试应用程序,您将看到以下消息:
RV:不支持语音合成
它由ResponsiveVoice填充,因为speechSynthesis不是在Android中定义的
在这里,你可以看到支持它,但在Android浏览器中不支持它,这是用于Cordova应用程序的浏览器。
https://stackoverflow.com/questions/41733645
复制相似问题