Domanda

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

È stato utile?

Soluzione

Tried in chrome canary and it works! Browser issue, hope they'll fix it soon

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top