vue 文字转语音播报


toRead(){
          if ('speechSynthesis' in window) {
            let readStr = '这是测试播报内容';
            if(this.speech){
              this.$message.error('当前正在播报,请勿重复点击!')
              return
            }
            this.$nextTick(()=>{
              this.speech = new SpeechSynthesisUtterance(readStr);
              this.speech.rate = 1 //语速:1-10
              this.speech.pitch = 1 //语调:1-2
              this.speech.onend = (()=>{
                this.speech = null //播报结束
              })
              this.synth.speak(this.speech);
            })
          }else{
            this.$message.error('当前浏览器不支持语音报单')
          }
        },

这原生API调用,理论上谷歌、EDG浏览器都支持,部分浏览器可能不支持


SQL Server 索引碎片率查询及维护

Windows环境部署deepseek及API接口调用

评 论
更换验证码