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