Files
30-seconds-of-code/test/speechSynthesis/speechSynthesis.js
2018-02-04 17:38:39 +02:00

6 lines
210 B
JavaScript

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