-
-
Save adentranter/ee5f02cd5bc6bff4bee9b01a41c02aca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
var recognition = new webkitSpeechRecognition(); | |
recognition.continuous = true; | |
//recognition.interimResults = true; | |
function start(){ | |
recognition.onresult = function(event) { | |
console.log(event); | |
var output = document.getElementById("output"); | |
output.innerHTML = ""; | |
for(var i=0; i<event.results.length; i++){ | |
output.innerHTML = output.innerHTML + event.results[i][0].transcript; | |
} | |
} | |
recognition.start(); | |
} | |
</script> | |
</head> | |
<body> | |
<h1>Speach to text</h1> | |
<input id = "bStart" type = "button" value = "Start" onclick = "start();"> | |
<div id = "output"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment