Às vezes eu escrevo...
willianjusten.com.brvar audio = new Audio();
audio.src = 'track.mp3';
audio.loop = true;
audio.autoplay = true;
audio.crossOrigin = "anonymous";
audioContext = new window.AudioContext();
source = audioContext.createMediaElementSource(audio);
analyser = audioContext.createAnalyser();
fbc_array = new Uint8Array(analyser.frequencyBinCount);
source.connect(analyser);
analyser.connect(audioContext.destination);
function frameLooper() {
window.requestAnimationFrame(frameLooper);
analyser.getByteFrequencyData(fbc_array);
render();
}