Skip to content

Instantly share code, notes, and snippets.

@eric-wood
Created January 19, 2018 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eric-wood/b9f50517c5d103bcc773be85ed9f0a6d to your computer and use it in GitHub Desktop.
Save eric-wood/b9f50517c5d103bcc773be85ed9f0a6d to your computer and use it in GitHub Desktop.
var voice;
for(v of window.speechSynthesis.getVoices()) {
if(v.name === 'Fred') {
voice = v;
break;
}
}
const utterance = new SpeechSynthesisUtterance('Fitter. Happier. More productive.');
utterance.voice = voice;
window.speechSynthesis.speak(utterance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment