Summary
The README advertises loading "sounds" from archives, but there is no LoadSoundFromPhysFS(). Callers (including our own example examples/audio/audio_sound_loading.c, lines 31–35) must manually do:
Wave wav = LoadWaveFromPhysFS("res/sound.wav");
Sound fx = LoadSoundFromWave(wav);
UnloadWave(wav);
Every other common raylib file loader has a ...FromPhysFS counterpart (LoadImageFromPhysFS, LoadTextureFromPhysFS, LoadWaveFromPhysFS, LoadMusicStreamFromPhysFS, LoadFontFromPhysFS, LoadShaderFromPhysFS). LoadSound() is the missing obvious one.
Proposed API
RAYLIB_PHYSFS_DEF Sound LoadSoundFromPhysFS(const char* fileName); // Load a sound from PhysFS
Suggested Implementation
In raylib-physfs.h, next to LoadWaveFromPhysFS():
Sound LoadSoundFromPhysFS(const char* fileName) {
Wave wave = LoadWaveFromPhysFS(fileName);
if (wave.data == NULL) {
Sound output = { 0 };
return output;
}
Sound sound = LoadSoundFromWave(wave);
UnloadWave(wave);
return sound;
}
- Add the declaration to the header block and the README API list.
- Simplify
examples/audio/audio_sound_loading.c to use it.
QA
- New test in
test/raylib-physfs-test.c — note LoadSoundFromWave() needs the audio device only for playback in some raylib versions; if headless CI can't validate the Sound, at minimum assert the missing-file path returns a zeroed Sound (AssertEqual(sound.stream.buffer, 0)), mirroring the existing LoadWaveFromPhysFS missing-file test at test/raylib-physfs-test.c:162.
- Example still builds and plays both WAV and OGG.
Context
Summary
The README advertises loading "sounds" from archives, but there is no
LoadSoundFromPhysFS(). Callers (including our own exampleexamples/audio/audio_sound_loading.c, lines 31–35) must manually do:Every other common raylib file loader has a
...FromPhysFScounterpart (LoadImageFromPhysFS,LoadTextureFromPhysFS,LoadWaveFromPhysFS,LoadMusicStreamFromPhysFS,LoadFontFromPhysFS,LoadShaderFromPhysFS).LoadSound()is the missing obvious one.Proposed API
Suggested Implementation
In
raylib-physfs.h, next toLoadWaveFromPhysFS():examples/audio/audio_sound_loading.cto use it.QA
test/raylib-physfs-test.c— noteLoadSoundFromWave()needs the audio device only for playback in some raylib versions; if headless CI can't validate theSound, at minimum assert the missing-file path returns a zeroedSound(AssertEqual(sound.stream.buffer, 0)), mirroring the existingLoadWaveFromPhysFSmissing-file test at test/raylib-physfs-test.c:162.Context
LoadModelFromPhysFS()#17, AddLoadModelAnimationFromPhysFS()#18, AddLoadMaterialsFromPhysFS()#19, AddLoadAutomationEventListFromPhysFS()#21; this issue is intentionally scoped toLoadSoundonly.