您好,脚本朋友,我正在开发一个从网站读取文本的应用程序。我们已经创建了该站点(medispeak.eu),并在网络视图中“打开”它。但是问题是,文本语音转换功能在应用程序内部无法运行,但在常规浏览器中却可以运行。
有谁知道如何解决这一问题?
这是错误日志:
6-23 09:53:51.889 17188-17188 / hobby_pc.medispeak I /铬:
[INFO:CONSOLE(8)]“ ResponsiveVoice r1.4.7”,来源:
https://code.responsivevoice.org/responsivevoice.js(8)06-23
09:53:51.999 17188-17188 / hobby_pc.medispeak V / ActivityThread:
updateVisibility:ActivityRecord {369df6d0
令牌=android.os.BinderProxy@38d5c740
{hobby_pc.medispeak / hobby_pc.medispeak.MainActivity}}显示:false
06-23 09:53:52.149 17188-17188 / hobby_pc.medispeak I / chromium:
[INFO:CONSOLE(47)]“ RV:不支持语音合成”,来源:
https://code.responsivevoice.org/responsivevoice.js(47)06-23
09:53:52.149 17188-17188 / hobby_pc.medispeak I /铬:
[INFO:CONSOLE(49)]“ RV:启用后备模式”,来源:
https://code.responsivevoice.org/responsivevoice.js(49)
I/chromium: [INFO:CONSOLE(99)] "speak.js: worker processing took 12513.00 ms", source: http://www.medispeak.eu/speakClient.js (99)
06-23 09:52:15.789 12277-12277/hobby_pc.medispeak I/chromium: [INFO:CONSOLE(0)] "Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.", source: http://www.medispeak.eu/ (0)
06-23 09:52:15.799 12277-12277/hobby_pc.medispeak I/chromium: [INFO:CONSOLE(86)] "speak.js: wav processing took 2838.00 ms", source: http://www.medispeak.eu/speakClient.js (86)
06-23 09:52:17.709 12277-12277/hobby_pc.medispeak I/chromium: [INFO:CONSOLE(59)] "Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture.", source: http://www.medispeak.eu/speakClient.js (59)
最佳答案
尝试使用高级的Webview库,
例如AdvancedWebView。