Reputation: 26940
I want to log audio data that i get from microphone:
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();
var analyser = context.createAnalyser();
navigator.webkitGetUserMedia({ audio: true }, function (stream) {
var source = context.createMediaStreamSource(stream);
source.connect(analyser);
analyser.connect(context.destination);
setInterval(function () {
var array = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(array);
console.log(array);
}, 1000);
}, function () { });
I'm talking in microphone but logged array contains only 0 values every time. Can you tell me what i'm doing wrong? Thanks
Upvotes: 2
Views: 2132
Reputation: 26940
Tried in chrome canary and it works! Browser issue, hope they'll fix it soon
Upvotes: 1