let utterThis = new SpeechSynthesisUtterance('書以啟智,技于謀生,活出斜杠'); speechSynthesis.speak(utterThis); 實(shí)現(xiàn)這個(gè)語音朗讀,需要用構(gòu)造器函數(shù)SpeechSynthesisUtterance方法,實(shí)例對象下,調(diào)用speak方法,即可實(shí)現(xiàn)語音的播報(bào) 除了使用speak方法,我們還可以實(shí)例對象屬性text,因此上面的代碼也可以寫成 1 2 3 4 5 ...
www.dbjr.com.cn/javascript/3022537...htm 2025-6-4