Files
30-seconds-of-code/test/speechSynthesis/speechSynthesis.js
2018-01-09 06:09:49 -05:00

5 lines
169 B
JavaScript

module.exports = message => {
const msg = new SpeechSynthesisUtterance(message);
msg.voice = window.speechSynthesis.getVoices()[0];
window.speechSynthesis.speak(msg);
};