We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 861b6f4 + 11092d4 commit e01353eCopy full SHA for e01353e
src/components/audio-waveform/index.tsx
@@ -92,11 +92,12 @@ const AudioWaveform = ({
92
canvas.width = width;
93
canvas.height = height;
94
95
+ const bufferLength = analyser.frequencyBinCount;
96
+ const dataArray = new Uint8Array(bufferLength);
97
+
98
const draw = () => {
99
if (!analyser || !ctx) return;
100
- const bufferLength = analyser.frequencyBinCount;
- const dataArray = new Uint8Array(bufferLength);
101
analyser.getByteFrequencyData(dataArray);
102
103
ctx.clearRect(0, 0, width, height);
0 commit comments