6#include <unordered_map>
66 AudioHandle play(
const std::filesystem::path& path,
float volume = 1.0f,
bool loop =
false);
Holds decoded PCM audio data as an engine asset.
std::unordered_map< AudioHandle, PlayingSound > playingSounds_
bool isPlaying(AudioHandle handle) const
Check if a sound is currently playing.
void onAudioLoaded(Assets::Audio *asset, const std::filesystem::path &path)
Called by AudioAssetPipeline when an asset finishes loading. Registers the asset for playback.
void stopAll()
Stop all currently playing sounds.
void cleanupFinishedSounds()
void cleanup()
Shut down the audio engine and free all resources.
void setMasterVolume(float volume)
Set the master volume.
AudioEngine(const AudioEngine &)=delete
std::unordered_map< std::string, RegisteredAudio > registeredAudio_
bool init()
Initialize the miniaudio engine with AudioConfig settings.
AudioEngine & operator=(const AudioEngine &)=delete
bool isInitialized() const
Check if the audio engine initialized successfully.
AudioHandle play(const std::filesystem::path &path, float volume=1.0f, bool loop=false)
Play a loaded audio clip.
void stop(AudioHandle handle)
Stop a playing sound.
Core audio subsystem owning the miniaudio engine and managing playback.
constexpr AudioHandle INVALID_AUDIO_HANDLE
uint32_t AudioHandle
Identifies a playing sound instance.