Skip to content

Instantly share code, notes, and snippets.

@igorcosta
Created December 8, 2016 02:49
Show Gist options
  • Save igorcosta/aa17f85602f24a7208f0394f6cff7dc2 to your computer and use it in GitHub Desktop.
Save igorcosta/aa17f85602f24a7208f0394f6cff7dc2 to your computer and use it in GitHub Desktop.
speechSynthesis
function sayit(text,voice) {
var msg = new SpeechSynthesisUtterance();
msg.voice = speechSynthesis.getVoices().filter(v => v.name == voice)[0];
msg.text = text;
speechSynthesis.speak(msg);
}; sayit ('choice mate!','English UK English Male');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment