Created
April 23, 2013 09:12
-
-
Save grudelsud/5442042 to your computer and use it in GitHub Desktop.
sample code of mic level + webspeech. the code kind of works, but asks twice for mic authorization.
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
var that = this; | |
var recognition = new webkitSpeechRecognition(); | |
recognition.continuous = true; | |
recognition.interimResults = true; | |
recognition.onstart = function() | |
{ | |
var context = new webkitAudioContext(); | |
navigator.webkitGetUserMedia( | |
{ | |
audio: true | |
}, | |
function(stream) | |
{ | |
var liveSource = context.createMediaStreamSource(stream); | |
var levelChecker = context.createJavaScriptNode(1024, 1 ,1); | |
liveSource.connect(levelChecker); | |
levelChecker.connect(context.destination); | |
levelChecker.onaudioprocess = that.processAudio; | |
} | |
); | |
that.isRunning(true); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
How to get mp3 file with Web Speech API?