Created
January 22, 2015 23:17
-
-
Save szolotykh/e57476ff257bf1ae01b0 to your computer and use it in GitHub Desktop.
HTML5 Speech to text example
This file contains 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();"></input> | |
<div id = "output"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's broken, jim