[JavaScript] Test Text-to-Speech in Web Speech API

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).


<input type="text" value="hello world" id="text">
<button type="button" id="tts">Text to Speech</button>


var input = document.querySelector("#text");
var tts = document.querySelector("#tts");

tts.addEventListener("click", function(e) {
  var text = new SpeechSynthesisUtterance(input.value);


[1]Using Google Text-To-Speech in Javascript - Stack Overflow
[2]Web apps that talk - Introduction to the Speech Synthesis API  |  Web  |  Google Developers
[3]javascript - Web speech api not working currently in chromium / electron / nw js? - Stack Overflow