We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
首次打开页面 调用语音不播放, 调用 hasBrowserSupport方法会提示浏览器不支持,但是用用点击事件去调用播放方法,又可以播放。具体代码如下, vue中created中调用初始化的方法去播报,经常首次打开会失效。
created() { this.speechInit() }, speechInit() { this.speech = new Speech(); this.$nextTick(() => { if (this.speech.hasBrowserSupport()) { console.log("speech synthesis supported") this.$message.error("该浏览器不支持语音播报!"); } }) this.speech.setLanguage("zh-CN"); this.speech.init().then(() => { }); this.speakTtsSpeech('测试语音关闭效果。') setTimeout(() => { this.speakTtsSpeechStop() }, 1000) }, speakTtsSpeech(msg) { this.speech.speak({ text: msg, listeners: { onstart: () => { console.log("开始播放"); }, onend: () => { console.log("播放完毕"); }, onresume: () => { console.log("恢复播放"); }, }, }).then(() => { console.log("语音播报成功"); }); }, }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
首次打开页面 调用语音不播放, 调用 hasBrowserSupport方法会提示浏览器不支持,但是用用点击事件去调用播放方法,又可以播放。具体代码如下, vue中created中调用初始化的方法去播报,经常首次打开会失效。
The text was updated successfully, but these errors were encountered: