Skip to content

Instantly share code, notes, and snippets.

@NickFoden
Forked from eric-wood/fitter-happier.js
Created June 10, 2020 19:33
Show Gist options
  • Save NickFoden/f825b88baed6a0135f48a0f42516394a to your computer and use it in GitHub Desktop.
Save NickFoden/f825b88baed6a0135f48a0f42516394a 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