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/audio_engine.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio/audio_engine.cc') diff --git a/src/audio/audio_engine.cc b/src/audio/audio_engine.cc index 8e47eac..b4c4863 100644 --- a/src/audio/audio_engine.cc +++ b/src/audio/audio_engine.cc @@ -81,8 +81,8 @@ void AudioEngine::load_music_data(const TrackerScore* score, #endif } -void AudioEngine::update(float music_time, float dt) { - current_time_ = music_time; +void AudioEngine::update(double music_time, double dt) { + current_time_ = (float)music_time; // Pre-warm samples needed in next 2 seconds (lazy loading strategy) // TODO: Implement pre-warming based on upcoming pattern triggers -- cgit v1.2.3