diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-07 21:50:44 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-07 21:50:44 +0100 |
| commit | b43d31779684b259bea42999743804c265a54b89 (patch) | |
| tree | 976010fe16e7dd1aa55f10048fb4c6b8755f56da /src/platform/platform.h | |
| parent | 9d91a1b6f5fa26605fb8567e61603d07d2f6fd9e (diff) | |
fix(audio): Prevent events from triggering one frame early
Events were triggering 16ms early in miniaudio playback because music_time
was advanced at the START of the frame, causing events to be checked against
future time but rendered into the current frame.
Fix: Delay music_time advancement until AFTER rendering audio for the frame.
This ensures events at time T trigger during frame [T, T+dt], not [T-dt, T].
Sequence now:
1. tracker_update(current_music_time) - Check events at current time
2. audio_render_ahead(...) - Render audio for this frame
3. music_time += dt - Advance for next frame
Result: Events now play on-beat, matching WAV dump timing.
Diffstat (limited to 'src/platform/platform.h')
0 files changed, 0 insertions, 0 deletions
