From 8c5e41724fdfc3be24e95f48ae4b2be616404074 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 26 Mar 2026 10:09:34 +0100 Subject: fix(audio): P1-P3 fixes from audio code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P1 — correctness bugs: - tracker.cc: move delete[] loop before pool reset so guard condition is valid - audio_engine: replace tracker_reset() with tracker_init() in reset()/seek() so synth IDs are re-registered after synth_init() clears spectrogram slots - spectrogram_resource_manager: set spec.version in load_procedural() (was UB) P2 — minor bugs: - synth.cc: move pan clamp unconditionally before debug-only block - gen.cc: remove dead `freq` variable in generate_note_spectrogram() - tracker.cc: remove duplicate g_sample_synth_cache clear loop P3 — cleanup: - Replace hardcoded 32000.0f with RING_BUFFER_SAMPLE_RATE (5 sites) - audio.cc: extract clip_samples() helper, remove duplicated clip loops - audio_engine: inline update_silent(), remove no-op prewarm_for_time_range() - Remove stale comments: stdio.h include, NEW: labels, CACHING block, NOTE: - Move TODO(timing) drift notes from source to TODO.md handoff(Gemini): audio review implemented, 36/36 tests passing --- src/audio/audio_engine.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/audio/audio_engine.h') diff --git a/src/audio/audio_engine.h b/src/audio/audio_engine.h index 699213d..cc4c80a 100644 --- a/src/audio/audio_engine.h +++ b/src/audio/audio_engine.h @@ -50,17 +50,8 @@ class AudioEngine { // Get or create synth ID for a sample int get_or_register_synth_id(int sample_id); -#if !defined(STRIP_ALL) - // Seeking support - void prewarm_for_time_range(float start_time, float end_time); - void update_silent(float music_time); // Update without triggering audio -#endif - SpectrogramResourceManager resource_mgr_; - // NOTE: For now, synth and tracker are global C functions (not members) - // Future refactoring will convert them to member objects - // Mapping: sample_id → synth_id (lazy registration) int sample_to_synth_id_[MAX_SPECTROGRAM_RESOURCES]; -- cgit v1.2.3