feat(audio): Audio System — SDL3 streaming, spatial 2D, SFX pool (RF4.8)#62
Merged
feat(audio): Audio System — SDL3 streaming, spatial 2D, SFX pool (RF4.8)#62
Conversation
… audio - Add AudioComponents.hpp: AudioClip and AudioEmitter structs (no SDL3 dep) - Add AudioSystem.hpp: AudioSource (SDL_AudioStream RAII) and AudioSystem with SFX pool, registerClip, playSFX/playSFXAt, spatial volume/pan math, master volume/pause, update loop (CF_HAS_SDL3 guarded) - Add test_audio.cpp: 22 tests covering defaults, init, spatial math, pool - Update Caffeine.hpp with audio includes - Update tests/CMakeLists.txt to compile test_audio.cpp under SDL3_FOUND - Update docs/fase4/audio.md (status ✅, API rewrite) and README.md
Closed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AudioComponents.hpp(always compiled) andAudioSystem.hpp(SDL3-guarded)test_audio.cppcovering defaults, init, spatial math, and pool stateFiles
src/audio/AudioComponents.hppAudioClip,AudioEmitterstructssrc/audio/AudioSystem.hppAudioSource(SDL_AudioStream RAII),AudioSystemtests/test_audio.cppsrc/Caffeine.hpptests/CMakeLists.txttest_audio.cppadded to SDL3 blockdocs/fase4/audio.mddocs/fase4/README.mdDesign Notes
AudioSourceis non-copyable (ownsSDL_AudioStream*), move-onlyregisterClip()takes raw PCM data — no file I/O, safe in headless CIinit()returnsfalsegracefully when no audio device is available; all ops are no-opsleftGain = vol * (1 - max(0, pan)),rightGain = vol * (1 + min(0, pan))init()— zero allocation at runtime