From 870a99d7253ff63628ce669059758512a18eadaa Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Tue, 10 Oct 2023 07:26:12 +0200 Subject: [PATCH] fix drawing multiple canvasses --- bin/web/js/audio.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/web/js/audio.js b/bin/web/js/audio.js index 7eacacf..55e709d 100644 --- a/bin/web/js/audio.js +++ b/bin/web/js/audio.js @@ -691,7 +691,7 @@ const Audio = function(tp, record) { // See comment above for Float32Array() const dataArrayAlt = new Uint8Array(bufferLengthAlt); - const canvasKeys = Object.keys(canvasCombos); + let canvasKeys = Object.keys(canvasCombos); for (let i = 0; i < canvasKeys.length; i++) { canvasCombos[canvasKeys[i]][1].clearRect(0, 0, w, h); @@ -699,6 +699,7 @@ const Audio = function(tp, record) { let frameCount = 0; const drawAlt = function() { + canvasKeys = Object.keys(canvasCombos); drawVisual = requestAnimationFrame(drawAlt); analyser.getByteFrequencyData(dataArrayAlt);