vue 文字转声音
const synth = window.speechSynthesis; const msg = new SpeechSynthesisUtterance(); export function voiceSpeak(e) { msg.text = e; msg.lang = 'zh-CN'; msg.volume = '1'; msg.rate = 1; msg.pitch = 1; // synth.cancel(); synth.speak(msg); }
记录下,
const synth = window.speechSynthesis; const msg = new SpeechSynthesisUtterance(); export function voiceSpeak(e) { msg.text = e; msg.lang = 'zh-CN'; msg.volume = '1'; msg.rate = 1; msg.pitch = 1; // synth.cancel(); synth.speak(msg); }
记录下,