I'm building a simple app in which I'm trying to get the buffer, but seems that onaudio process in the following code isn't firing: (PasteBin)
<script>
var audio_context;
var recorder;
window.onload = function init() {
try {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
window.URL = window.URL || window.webkitURL;
audio_context = new AudioContext;
} catch (e) {
console.log(e);
}
navigator.getUserMedia({audio: true}, startUserMedia);
function startUserMedia(stream) {
console.log('Initializing');
var input = audio_context.createMediaStreamSource(stream);
input.connect(audio_context.destination);
var node = input.context.createGain(4096, 2, 2);
node.onaudioprocess = function(e){
console.log('done');
}
node.connect(audio_context.destination);
}
};
</script>
If the code works as it should I should get Initiliazing \n done, the problem is that I'm getting only Initiazing and onaudioprocess isn't fired. I'm using the lastest chrome:
