7 for (
auto& [key, sound] :
_sounds) UnloadSound(sound);
14 if (!
_sounds.contains(key))
_sounds[key] = LoadSound(filepath.c_str());
Raylib audio manager implementation.
void init() override
Initializes the Raylib audio device.
void shutdown() override
Unloads all cached sounds and closes the Raylib audio device.
std::unordered_map< std::string, Sound > _sounds
Caches loaded sounds to avoid reloading them.
void playSound(const std::string &key, const std::string &filepath) override
Loads the sound if not cached, then plays it via Raylib.