diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-09 12:57:22 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-09 12:57:22 +0100 |
| commit | 807c6f5097897fac92428b939df020cdb70aae77 (patch) | |
| tree | e79322ab6a62b08a95cb3ecc7c7a24a962808f6c /src/audio/audio.h | |
| parent | 655d0a627c17b598562616a269e53bf06124d43f (diff) | |
fix: Audio startup hiccup - use fill_audio_buffer for pre-fill
- Added target_fill parameter to audio_render_ahead() for explicit control
- Pre-fill now uses fill_audio_buffer() (same logic as main loop)
- Ensures consistent tempo scaling and time advancement
- Reduced pre-fill from 400ms to 100ms (was blocking visuals)
- All 33 tests passing
handoff(Claude): Fixed audio startup silence/suspension issue
Diffstat (limited to 'src/audio/audio.h')
| -rw-r--r-- | src/audio/audio.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/audio/audio.h b/src/audio/audio.h index e063a57..778d312 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -24,7 +24,8 @@ void audio_init(); void audio_start(); // Starts the audio device callback // Ring buffer audio rendering (main thread fills buffer) -void audio_render_ahead(float music_time, float dt); +// target_fill: Target buffer fill time in seconds (default: RING_BUFFER_LOOKAHEAD_MS/1000) +void audio_render_ahead(float music_time, float dt, float target_fill = -1.0f); // Get current playback time (in seconds) based on samples consumed // This is the ring buffer READ position (what's being played NOW) |
