!7
p-exp { serveHttpIfMain(8123); }
html {
ret htitle("Speech Output Test")
+ p("Press F12 to open console")
+ "Text to say: " + htextinput("text", id := "thetext", onKeyUp := [[if (event.keyCode == 13) { say(document.getElementById("thetext").value); return false; }]])
+ hWebKitSayFunction()
+ hjavascript([[
console.log("Voices: " + window.speechSynthesis.getVoices().length);
var speaking = true;
function checkStatus() {
var s = window.speechSynthesis.speaking;
if (s != speaking)
if (s)
console.log("Speaking");
else
console.log("Not speaking");
speaking = s;
setTimeout(checkStatus, 200);
}
checkStatus();
]]);
}