Skip to content

AudioResources

Generated from engine/audio/audio_resources.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the audio module

#include "engine/audio/audio_resources.h" · namespace labrador

The sound banks, cached by name. The audio counterpart to RenderResources, and separate from it because the module table (ARCHITECTURE.md) has render and audio depending on core and math alone - neither knows the other exists, so nothing that only draws has to compile the audio stack to do it.

using SoundBankHandle = Handle<SoundBank>;
AudioResources() = default;
SoundBankHandle resolve_sound_bank(const std::string& sound_bank_name) const;

Load-time. Throws std::out_of_range naming the bank if nothing loaded it. Same bargain as RenderResources: resolve a name once, keep the handle, and never search by name again.

SoundBank* sound_bank(SoundBankHandle sound_bank) const;
SoundBank* sound_bank(const std::string& sound_bank_name) const;

Const and non-mutating, like every other registry getter: throws std::out_of_range naming the bank if it is absent or released.

void add_sound_bank(const std::string& sound_bank_name,
std::unique_ptr<SoundBank> sound_bank);

Deliberately nothing releases a bank short of the destructor. Banks are not device resources, so a device loss leaves them alone, and releasing one would leave every live object holding a freed SoundBank*. A bank holds only handles: the voices and the wave bank behind them belong to the AudioDevice, which releases them itself.

Named in the public declarations above: Handle, SoundBank.

The files that include this header directly. A file can also reach it through another header.

Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.