相关疑难解决方法(0)

自M71以来,不再允许未经用户激活的JavaScript speechSynthesis.speak()

我以这种方式使用了SpeechSynthesis API:

speechSynthesis.speak(new SpeechSynthesisUtterance("hello world"));
Run Code Online (Sandbox Code Playgroud)

但是现在更新Google Chrome后出现错误:

自2018年12月左右以来,自M71开始,不再允许未经用户激活的[Deprecation] speechSynthesis.speak()。有关更多详细信息,请参见 https://www.chromestatus.com/feature/5687444770914304

如何解决此问题并寻求许可?

javascript google-chrome speech-synthesis

6
推荐指数
3
解决办法
4053
查看次数