From 8bee7577cba9f55be8bc404038d5df959595b989 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 28 Mar 2026 18:45:42 +0100 Subject: fix(audio): fix early timing drift in tracker, use ola_decode_frame in synth - Replaced chunk_frames truncation accumulation with accurate double-precision integration in audio_render_ahead. - Updated tracker to use double-precision time representations for exact sample-accurate scheduling. - Extracted ola_decode_frame to handle per-frame OLA-IDCT synthesis in synth.cc. - Updated TODO.md for completed audio tasks. handoff(Claude): Audio timing drift and OLA-IDCT enhancement resolved. --- src/audio/ola.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/audio/ola.h') diff --git a/src/audio/ola.h b/src/audio/ola.h index 2d6267e..1fb2a4a 100644 --- a/src/audio/ola.h +++ b/src/audio/ola.h @@ -18,3 +18,9 @@ void ola_encode(const float* pcm, int n_samples, float* spec, int num_frames); // Hann at 50% overlap satisfies w[n]+w[n+H]=1 → perfect reconstruction. // pcm must hold num_frames * OLA_HOP_SIZE floats. void ola_decode(const float* spec, int num_frames, float* pcm); + +// Single-frame OLA-IDCT decoder. +// spec_frame: single DCT_SIZE spectral frame. +// overlap: OLA_OVERLAP buffer (read/write). Must be zero-initialized for first frame. +// out_hop: OLA_HOP_SIZE buffer for the resulting time-domain samples. +void ola_decode_frame(const float* spec_frame, float* overlap, float* out_hop); -- cgit v1.2.3