on webkit browsers you can use get the api user interface with webkitGetUserMedia- as shown in html5rocks .
if you want to use your voice to create javascript events (for example, to control objects on the screen), you will have to analyze the incoming sound (for example, high frequency for event1 - low frequency for event2, speech analysis is much more complicated, see below)
alternatively, there is chrome speech recognition "x-webkit-speech" (see the example here ), which will analyze speech on google servers and therefore probably too slow for real-time control.
I do not know the real-time speech analysis in the browser, but would be glad to find (even a very basic) feature.
edit: add some code (adapted from here )
<html>
<head>
</head
<body>
<input type="search" id="mike" x-webkit-speech>
<script type="text/javascript">
var mike = document.getElementById('mike');
mike.onwebkitspeechchange = function(e) {
console.log(e);
console.log(e.results[0].utterance);
};
</script>
</body>
</html>
source
share