1

I have little problem. I'm trying to analyze mp3 sound. But I don't want to do it real-time (it works perfect for me). I have problem with OfflineAudioContext, documentation is written rly bad, no examples or something. Best result was a lot of empty arrays [i mean a lot of zeros].

window.onload = function() {

    var offline = new OfflineAudioContext(2, 40000, 44100);
    var audio = document.getElementById('myAudio'); 
    var audioSrc = offline.createMediaElementSource(audio);

    var analyser = offline.createAnalyser();

    audioSrc.connect(analyser);
    analyser.connect(offline.destination);

    var frequencyData = new Uint8Array(analyser.frequencyBinCount);

    offline.oncomplete = function(ev){
        console.log(ev.renderedBuffer.getChannelData(0));
    }

    offline.startRendering();
}

How I can access frequency of each moment to visualization?

Thanks a lot for answer, cya guys.

jww
  • 97,681
  • 90
  • 411
  • 885

0 Answers0