Mobile 演讲可以在后台播放吗?

Mobile 演讲可以在后台播放吗?,mobile,progressive-web-apps,webspeech-api,Mobile,Progressive Web Apps,Webspeech Api,我正在开发一个移动web应用程序,该应用程序使用web语音API提供文本到语音的功能,但是当web浏览器不关注移动设备时,我的SpeechSynthesistence会静音 无论用户是否离开web浏览器,我如何使语音合成继续进行,直到发音完成 我到处寻找解决方案,但在Chrome或Safari的背景下找不到任何有效的解决方案。非常感谢你的帮助 以下是点击触发的脚本(即使Firefox在后台也能工作): var to_speak = new window.SpeechSynthesisUttera

我正在开发一个移动web应用程序,该应用程序使用web语音API提供文本到语音的功能,但是当web浏览器不关注移动设备时,我的SpeechSynthesistence会静音

无论用户是否离开web浏览器,我如何使语音合成继续进行,直到发音完成

我到处寻找解决方案,但在Chrome或Safari的背景下找不到任何有效的解决方案。非常感谢你的帮助

以下是点击触发的脚本(即使Firefox在后台也能工作):

var to_speak = new window.SpeechSynthesisUtterance("These words are synthesized perfectly by the browser, but everything comes to an abrupt stop as soon as the browser is not in focus.");

window.speechSynthesis.speak(to_speak);