let utterThis = new SpeechSynthesisUtterance('');
export function beginread(text,pitch,rate) {
utterThis.pitch = pitch || 1; // 音高
utterThis.rate = rate || 1; // 语速
utterThis.volume = 1; // 音量
utterThis.lang = 'zh-CN';
utterThis.text = text;
window.speechSynthesis.speak(utterThis); //开始朗读
}
utterThis.onend = () => { //结束事件
window.speechSynthesis.cancel() //注销合成方法
}
export function endread(){ //调用关闭方法
utterThis.onend()
}