fix drawing multiple canvasses
This commit is contained in:
parent
35ed6009e2
commit
870a99d725
1 changed files with 2 additions and 1 deletions
|
@ -691,7 +691,7 @@ const Audio = function(tp, record) {
|
||||||
// See comment above for Float32Array()
|
// See comment above for Float32Array()
|
||||||
const dataArrayAlt = new Uint8Array(bufferLengthAlt);
|
const dataArrayAlt = new Uint8Array(bufferLengthAlt);
|
||||||
|
|
||||||
const canvasKeys = Object.keys(canvasCombos);
|
let canvasKeys = Object.keys(canvasCombos);
|
||||||
|
|
||||||
for (let i = 0; i < canvasKeys.length; i++) {
|
for (let i = 0; i < canvasKeys.length; i++) {
|
||||||
canvasCombos[canvasKeys[i]][1].clearRect(0, 0, w, h);
|
canvasCombos[canvasKeys[i]][1].clearRect(0, 0, w, h);
|
||||||
|
@ -699,6 +699,7 @@ const Audio = function(tp, record) {
|
||||||
|
|
||||||
let frameCount = 0;
|
let frameCount = 0;
|
||||||
const drawAlt = function() {
|
const drawAlt = function() {
|
||||||
|
canvasKeys = Object.keys(canvasCombos);
|
||||||
drawVisual = requestAnimationFrame(drawAlt);
|
drawVisual = requestAnimationFrame(drawAlt);
|
||||||
|
|
||||||
analyser.getByteFrequencyData(dataArrayAlt);
|
analyser.getByteFrequencyData(dataArrayAlt);
|
||||||
|
|
Loading…
Reference in a new issue