Files
30-seconds-of-code/test/speechSynthesis/speechSynthesis.js
2018-08-02 13:49:33 +03:00

7 lines
217 B
JavaScript

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