5
JavaScript speech synthesis cheatsheet
source link: https://devhints.io/js-speech
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
JavaScript speech synthesis cheatsheet
function speak (message) {
var msg = new SpeechSynthesisUtterance(message)
var voices = window.speechSynthesis.getVoices()
msg.voice = voices[0]
window.speechSynthesis.speak(msg)
}
speak('Hello, world')
See: SpeechSynthesisUtterance (developer.mozilla.org)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK