blob: 3fd0dd83953bbd2ebe05594e5c89804933639232 [file] [log] [blame]
<body onload="start()">
<script>
var speechRecognition = null;
function start()
{
stop();
speechRecognition = new webkitSpeechRecognition();
speechRecognition.onerror = (event) => {
window.webkit.messageHandlers.testHandler.postMessage("Error: " + event.error + " - " + event.message);
}
speechRecognition.onend = (event) => {
window.webkit.messageHandlers.testHandler.postMessage("End");
}
speechRecognition.start();
}
function stop()
{
if (!speechRecognition)
return;
speechRecognition.stop();
speechRecognition = null;
}
</script>
</body>