fix drawing multiple canvasses

This commit is contained in:
jrkb 2023-10-10 07:26:12 +02:00
parent 35ed6009e2
commit 870a99d725

View file

@ -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);