revert visualizer throttling

This commit is contained in:
2026-09-07 19:57:53 -04:00
parent 48076fcef5
commit 9702af640b
2 changed files with 2 additions and 51 deletions

View File

@@ -344,7 +344,6 @@ function createVisualizerStore(): VisualizerStore {
// ── Render loop (called at ~30fps) ─────────────────────────────────
let lastBarWriteAt = 0;
const renderFrame = () => {
if (!cava?.isReady || !sampleBuffer || !pcm) return;
@@ -377,15 +376,8 @@ function createVisualizerStore(): VisualizerStore {
if (count < sampleBuffer.length) return;
const output = cava.execute(sampleBuffer);
// Write the UI signal at ~10fps, not 30: cava already smooths
// (noise reduction + peak release), and each Solid write costs a
// renderer diff pass. 3 of every 4 frames update only the pipeline.
const nowMs = performance.now();
if (nowMs - lastBarWriteAt >= 95) {
lastBarWriteAt = nowMs;
// Normalize against the running peak and copy to a new array
setBarData(scaler(output));
}
// Normalize against the running peak and copy to a new array
setBarData(scaler(output));
// Fresh frames only count once the position clock has MOVED from
// the resume point: while the player is still re-buffering after a
// long pause, the cache serves the same window and the spinner must