var msg = new SpeechSynthesisUtterance();
msg.text = "Hello World";
window.speechSynthesis.speak(msg);
const speak = (msg) => {
const sp = new SpeechSynthesisUtterance(msg);
[sp.voice] = speechSynthesis.getVoices();
speechSynthesis.speak(sp);
}
speak('Hi, Welcome to Javascript Text to Speech. It is really awesome.');
function readOutLoud(message) {
var speech = new SpeechSynthesisUtterance();
// Set the text and voice attributes.
speech.text = message;
speech.volume = 1;
speech.rate = 1;
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
$('#start-record-btn').on('click', function(e) {
recognition.start();
});