Test Text-to-Speech (TTS) feature in Web Speech API. Not working in Chromium
57, but working in Firefox 53 (both running on Ubuntu Linux 17.04).
HTML:
<input type="text" value="hello world" id="text">
<button type="button" id="tts">Text to Speech</button>
JavaScript:
var input = document.querySelector("#text");
var tts = document.querySelector("#tts");
tts.addEventListener("click", function(e) {
var text = new SpeechSynthesisUtterance(input.value);
window.speechSynthesis.speak(text);
});
References: