Game Audio Module
A C++ audio system using miniaudio with Python bindings
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
audio::AudioManager Class Reference

Central manager for all audio functionality. More...

#include <audio_manager.h>

Public Member Functions

bool IsInitialized () const
 Check if the audio system is initialized and running.
 
System Lifecycle
bool Initialize ()
 Initialize the audio system.
 
void Shutdown ()
 Shut down the audio system.
 
Track Management
TrackHandle CreateTrack ()
 Create a new audio track.
 
void DestroyTrack (TrackHandle track)
 Destroy an audio track.
 
void PlayTrack (TrackHandle track)
 Start playing an audio track.
 
void StopTrack (TrackHandle track)
 Stop playing an audio track.
 
Layer Operations
void AddLayer (TrackHandle track, const string &layerName, const string &filepath, GroupHandle group=GroupHandle::Invalid())
 Add an audio layer to a track.
 
void RemoveLayer (TrackHandle track, const string &layerName)
 Remove a layer from a track.
 
void SetLayerVolume (TrackHandle track, const string &layerName, float volume)
 Set the volume of a specific layer.
 
void FadeLayer (TrackHandle track, const string &layerName, float targetVolume, std::chrono::milliseconds duration)
 Fade a layer's volume to a target value over time.
 
Group Operations
GroupHandle CreateGroup ()
 Create a new audio group.
 
void DestroyGroup (GroupHandle group)
 Destroy an audio group.
 
void SetGroupVolume (GroupHandle group, float volume)
 Set the volume for an entire audio group.
 
float GetGroupVolume (GroupHandle group) const
 Get the current volume for an audio group.
 
void FadeGroup (GroupHandle group, float targetVolume, std::chrono::milliseconds duration)
 Fade a group's volume to a target value over time.
 
Sound Operations
SoundHandle LoadSound (const string &filepath)
 Load a sound from a file.
 
SoundHandle LoadSound (const string &filepath, GroupHandle group)
 Load a sound from a file and assign it to a group.
 
void DestroySound (SoundHandle sound)
 Destroy a previously loaded sound.
 
void PlaySound (SoundHandle sound)
 Play a sound.
 
void PlaySound (SoundHandle sound, const Vec3 &position)
 Play a sound at a specific position.
 
void StopSound (SoundHandle sound)
 Stop a currently playing sound.
 
void SetSoundVolume (SoundHandle sound, float volume)
 Set the volume of a sound.
 
void SetSoundPitch (SoundHandle sound, float pitch)
 Set the pitch of a sound for its next playback.
 
void SetSoundLooping (SoundHandle sound, bool should_loop)
 Set whether a sound should loop.
 
bool IsSoundPlaying (SoundHandle sound) const
 Check if a sound is currently playing.
 
void PlayRandomSoundFromFolder (const string &folderPath, GroupHandle group=GroupHandle::Invalid())
 Play a random sound from a folder.
 
Spatial Audio (3D Positioning)
void SetListenerPosition (const Vec3 &position, uint32_t listenerIndex=0)
 Set the listener position in 3D space.
 
Vec3 GetListenerPosition (uint32_t listenerIndex=0) const
 Get the listener position.
 
void SetListenerDirection (const Vec3 &direction, uint32_t listenerIndex=0)
 Set the listener direction (forward vector)
 
Vec3 GetListenerDirection (uint32_t listenerIndex=0) const
 Get the listener direction.
 
void SetListenerUp (const Vec3 &up, uint32_t listenerIndex=0)
 Set the listener up vector.
 
Vec3 GetListenerUp (uint32_t listenerIndex=0) const
 Get the listener up vector.
 
void SetSoundPosition (SoundHandle sound, const Vec3 &position)
 Set the 3D position of a sound.
 
Vec3 GetSoundPosition (SoundHandle sound) const
 Get the 3D position of a sound.
 
void SetSoundMinDistance (SoundHandle sound, float minDistance)
 Set the minimum distance for distance attenuation.
 
float GetSoundMinDistance (SoundHandle sound) const
 Get the minimum distance of a sound.
 
void SetSoundMaxDistance (SoundHandle sound, float maxDistance)
 Set the maximum distance for distance attenuation.
 
float GetSoundMaxDistance (SoundHandle sound) const
 Get the maximum distance of a sound.
 
void SetSoundRolloff (SoundHandle sound, float rolloff)
 Set the rolloff factor for distance attenuation.
 
float GetSoundRolloff (SoundHandle sound) const
 Get the rolloff factor of a sound.
 
void SetSoundSpatializationEnabled (SoundHandle sound, bool enabled)
 Enable or disable spatialization for a sound.
 
bool IsSoundSpatializationEnabled (SoundHandle sound) const
 Check if spatialization is enabled for a sound.
 

Static Public Member Functions

static AudioManagerGetInstance ()
 Get the singleton instance of the AudioManager.
 

Private Member Functions

 AudioManager ()
 Constructor - private due to singleton pattern.
 
 AudioManager (const AudioManager &)=delete
 
 ~AudioManager ()
 Destructor.
 
void EnsureInitialized () const
 Ensures the audio system is initialized before use.
 
AudioManageroperator= (const AudioManager &)=delete
 
Internal Handle Management
TrackHandle NextTrackHandle ()
 Generate a new track handle.
 
GroupHandle NextGroupHandle ()
 Generate a new group handle.
 
SoundHandle NextSoundHandle ()
 Generate a new sound handle.
 

Private Attributes

Resource Storage
unique_ptr< AudioSystemaudio_system_
 Core audio system.
 
unordered_map< TrackHandle, unique_ptr< AudioTrack > > tracks_
 Track storage.
 
unordered_map< GroupHandle, unique_ptr< AudioGroup > > groups_
 Group storage.
 
unordered_map< SoundHandle, unique_ptr< Sound > > sounds_
 Sound storage.
 
unordered_map< string, std::vector< SoundHandle > > folder_sounds_
 Cached sounds per folder.
 
Threading
atomic< bool > running_ {false}
 Flag indicating if audio system is running.
 
thread update_thread_
 Thread for audio updates.
 
mutex resource_mutex_
 Mutex for thread-safe resource access (mutable for const methods)
 
std::mt19937 rng_ {std::random_device{}()}
 RNG for random playback.
 
Handle Counters
atomic< uint32_t > next_track_handle_ {1}
 Counter for generating unique track handles.
 
atomic< uint32_t > next_group_handle_ {1}
 Counter for generating unique group handles.
 
atomic< uint32_t > next_sound_handle_ {1}
 Counter for generating unique sound handles.
 

System Control

static void SetLogLevel (LogLevel level)
 Set the global audio log level (runtime).
 
static LogLevel GetLogLevel ()
 Get the current audio log level.
 
void SetMasterVolume (float volume)
 Set the master volume for all audio.
 
float GetMasterVolume () const
 Get the current master volume level.
 

Detailed Description

Central manager for all audio functionality.

The AudioManager class provides a singleton interface for all audio operations. It manages audio tracks, groups, and individual sounds, providing a high-level API for game code to interact with the audio system.

This class handles resource management, playback control, volume adjustments, and other audio operations. It is the only class that should be directly accessed by game code.

@thread_safety All public methods are thread-safe and can be called from any thread. The internal update thread runs at ~60Hz and updates fading/volume transitions. All resource access is protected by internal mutexes.

Constructor & Destructor Documentation

◆ AudioManager() [1/2]

audio::AudioManager::AudioManager ( )
private

Constructor - private due to singleton pattern.

◆ ~AudioManager()

audio::AudioManager::~AudioManager ( )
private

Destructor.

◆ AudioManager() [2/2]

audio::AudioManager::AudioManager ( const AudioManager )
privatedelete

Member Function Documentation

◆ AddLayer()

void audio::AudioManager::AddLayer ( TrackHandle  track,
const string &  layerName,
const string &  filepath,
GroupHandle  group = GroupHandle::Invalid() 
)

Add an audio layer to a track.

Layers are individual sounds that play simultaneously within a track. They can be controlled individually for volume and transitions.

Parameters
trackHandle to the track
layerNameName identifier for the layer (unique within the track)
filepathPath to the audio file
groupOptional handle of the group this layer should belong to (invalid = default/master)
Exceptions
InvalidHandleExceptionIf the track handle is invalid or the group handle is invalid
FileLoadExceptionIf the audio file cannot be loaded

◆ CreateGroup()

GroupHandle audio::AudioManager::CreateGroup ( )

Create a new audio group.

Audio groups allow for collective control of multiple sounds. Groups are referenced by handle; names are not part of the public API.

Returns
GroupHandle Handle to the newly created group
Exceptions
AudioExceptionIf group creation fails

◆ CreateTrack()

TrackHandle audio::AudioManager::CreateTrack ( )

Create a new audio track.

Audio tracks can contain multiple layers of audio that play simultaneously, with individual volume control for each layer.

Returns
TrackHandle Handle to the newly created track

◆ DestroyGroup()

void audio::AudioManager::DestroyGroup ( GroupHandle  group)

Destroy an audio group.

Parameters
groupHandle to the group to destroy

◆ DestroySound()

void audio::AudioManager::DestroySound ( SoundHandle  sound)

Destroy a previously loaded sound.

Parameters
soundHandle to the sound to destroy

◆ DestroyTrack()

void audio::AudioManager::DestroyTrack ( TrackHandle  track)

Destroy an audio track.

This releases all resources associated with the track.

Parameters
trackHandle to the track to destroy

◆ EnsureInitialized()

void audio::AudioManager::EnsureInitialized ( ) const
private

Ensures the audio system is initialized before use.

Exceptions
NotInitializedExceptionIf Initialize() has not been called

◆ FadeGroup()

void audio::AudioManager::FadeGroup ( GroupHandle  group,
float  targetVolume,
std::chrono::milliseconds  duration 
)

Fade a group's volume to a target value over time.

Parameters
groupHandle to the group
targetVolumeTarget volume level (0.0 to 1.0)
durationDuration of the fade in milliseconds

◆ FadeLayer()

void audio::AudioManager::FadeLayer ( TrackHandle  track,
const string &  layerName,
float  targetVolume,
std::chrono::milliseconds  duration 
)

Fade a layer's volume to a target value over time.

Parameters
trackHandle to the track
layerNameName of the layer
targetVolumeTarget volume level (0.0 to 1.0)
durationDuration of the fade in milliseconds

◆ GetGroupVolume()

float audio::AudioManager::GetGroupVolume ( GroupHandle  group) const

Get the current volume for an audio group.

Parameters
groupHandle to the group
Returns
float Current volume level (0.0 to 1.0)

◆ GetInstance()

AudioManager & audio::AudioManager::GetInstance ( )
static

Get the singleton instance of the AudioManager.

Returns
AudioManager& Reference to the singleton instance

◆ GetListenerDirection()

Vec3 audio::AudioManager::GetListenerDirection ( uint32_t  listenerIndex = 0) const

Get the listener direction.

Parameters
listenerIndexIndex of the listener (default 0)
Returns
Vec3 Current listener direction

◆ GetListenerPosition()

Vec3 audio::AudioManager::GetListenerPosition ( uint32_t  listenerIndex = 0) const

Get the listener position.

Parameters
listenerIndexIndex of the listener (default 0)
Returns
Vec3 Current listener position

◆ GetListenerUp()

Vec3 audio::AudioManager::GetListenerUp ( uint32_t  listenerIndex = 0) const

Get the listener up vector.

Parameters
listenerIndexIndex of the listener (default 0)
Returns
Vec3 Current listener up vector

◆ GetLogLevel()

LogLevel audio::AudioManager::GetLogLevel ( )
static

Get the current audio log level.

◆ GetMasterVolume()

float audio::AudioManager::GetMasterVolume ( ) const

Get the current master volume level.

Returns
float Current master volume (0.0 to 1.0)

◆ GetSoundMaxDistance()

float audio::AudioManager::GetSoundMaxDistance ( SoundHandle  sound) const

Get the maximum distance of a sound.

Parameters
soundHandle to the sound
Returns
float Current maximum distance
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ GetSoundMinDistance()

float audio::AudioManager::GetSoundMinDistance ( SoundHandle  sound) const

Get the minimum distance of a sound.

Parameters
soundHandle to the sound
Returns
float Current minimum distance
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ GetSoundPosition()

Vec3 audio::AudioManager::GetSoundPosition ( SoundHandle  sound) const

Get the 3D position of a sound.

Parameters
soundHandle to the sound
Returns
Vec3 Current 3D position
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ GetSoundRolloff()

float audio::AudioManager::GetSoundRolloff ( SoundHandle  sound) const

Get the rolloff factor of a sound.

Parameters
soundHandle to the sound
Returns
float Current rolloff factor
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ Initialize()

bool audio::AudioManager::Initialize ( )

Initialize the audio system.

This function initializes the underlying audio system, including the miniaudio engine. It must be called before any other audio operations.

Returns
bool True if initialization was successful, false otherwise

◆ IsInitialized()

bool audio::AudioManager::IsInitialized ( ) const
inline

Check if the audio system is initialized and running.

Returns
bool True if the system is initialized, false otherwise

◆ IsSoundPlaying()

bool audio::AudioManager::IsSoundPlaying ( SoundHandle  sound) const

Check if a sound is currently playing.

Parameters
soundHandle to the sound
Returns
bool True if the sound is playing, false otherwise

◆ IsSoundSpatializationEnabled()

bool audio::AudioManager::IsSoundSpatializationEnabled ( SoundHandle  sound) const

Check if spatialization is enabled for a sound.

Parameters
soundHandle to the sound
Returns
bool True if spatialization is enabled
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ LoadSound() [1/2]

SoundHandle audio::AudioManager::LoadSound ( const string &  filepath)

Load a sound from a file.

Parameters
filepathPath to the audio file
Returns
SoundHandle Handle to the loaded sound
Exceptions
FileLoadExceptionIf the file cannot be found or loaded

◆ LoadSound() [2/2]

SoundHandle audio::AudioManager::LoadSound ( const string &  filepath,
GroupHandle  group 
)

Load a sound from a file and assign it to a group.

Parameters
filepathPath to the audio file
groupHandle to the audio group to assign the sound to
Returns
SoundHandle Handle to the loaded sound
Exceptions
FileLoadExceptionIf the file cannot be found or loaded

◆ NextGroupHandle()

GroupHandle audio::AudioManager::NextGroupHandle ( )
inlineprivate

Generate a new group handle.

Returns
GroupHandle New unique handle

◆ NextSoundHandle()

SoundHandle audio::AudioManager::NextSoundHandle ( )
inlineprivate

Generate a new sound handle.

Returns
SoundHandle New unique handle

◆ NextTrackHandle()

TrackHandle audio::AudioManager::NextTrackHandle ( )
inlineprivate

Generate a new track handle.

Returns
TrackHandle New unique handle

◆ operator=()

AudioManager & audio::AudioManager::operator= ( const AudioManager )
privatedelete

◆ PlayRandomSoundFromFolder()

void audio::AudioManager::PlayRandomSoundFromFolder ( const string &  folderPath,
GroupHandle  group = GroupHandle::Invalid() 
)

Play a random sound from a folder.

Loads all .wav files from the specified folder and plays one randomly. Sounds are cached after first load for efficiency.

Parameters
folderPathPath to the folder containing sound files
groupOptional group handle to assign the sounds to
Exceptions
AudioExceptionIf the folder path is empty
FileLoadExceptionIf the selected sound file cannot be loaded or initialized for playback

◆ PlaySound() [1/2]

void audio::AudioManager::PlaySound ( SoundHandle  sound)

Play a sound.

Parameters
soundHandle to the sound to play
Exceptions
InvalidHandleExceptionIf the sound handle is invalid
FileLoadExceptionIf the sound file cannot be loaded or initialized for playback

Play a sound

Starts playback of the sound using its current position.

Parameters
soundHandle to the sound
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ PlaySound() [2/2]

void audio::AudioManager::PlaySound ( SoundHandle  sound,
const Vec3 position 
)

Play a sound at a specific position.

Starts playback of the sound at the specified position. This allows multiple overlapping spatialized sounds from the same audio file to play at different positions simultaneously (e.g., multiple gunshots).

The position is only applied to this new playback instance. Existing instances keep their positions unchanged.

Parameters
soundHandle to the sound
position3D position for this playback instance
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ PlayTrack()

void audio::AudioManager::PlayTrack ( TrackHandle  track)

Start playing an audio track.

All layers in the track will begin playing.

Parameters
trackHandle to the track to play
Exceptions
InvalidHandleExceptionIf the track handle is invalid
FileLoadExceptionIf any layer's sound file cannot be loaded or initialized for playback

◆ RemoveLayer()

void audio::AudioManager::RemoveLayer ( TrackHandle  track,
const string &  layerName 
)

Remove a layer from a track.

Parameters
trackHandle to the track
layerNameName of the layer to remove

◆ SetGroupVolume()

void audio::AudioManager::SetGroupVolume ( GroupHandle  group,
float  volume 
)

Set the volume for an entire audio group.

This affects all sounds assigned to the group.

Parameters
groupHandle to the group
volumeVolume level (0.0 to 1.0)
Exceptions
InvalidHandleExceptionIf the group handle is invalid

◆ SetLayerVolume()

void audio::AudioManager::SetLayerVolume ( TrackHandle  track,
const string &  layerName,
float  volume 
)

Set the volume of a specific layer.

Parameters
trackHandle to the track
layerNameName of the layer
volumeVolume level (0.0 to 1.0)

◆ SetListenerDirection()

void audio::AudioManager::SetListenerDirection ( const Vec3 direction,
uint32_t  listenerIndex = 0 
)

Set the listener direction (forward vector)

The direction vector represents which way the listener is facing. Should be normalized.

Parameters
directionForward direction vector (should be normalized)
listenerIndexIndex of the listener (default 0)

◆ SetListenerPosition()

void audio::AudioManager::SetListenerPosition ( const Vec3 position,
uint32_t  listenerIndex = 0 
)

Set the listener position in 3D space.

The listener represents the "ears" of the player/camera. All spatialized sounds are positioned relative to the listener.

Coordinate System: Uses OpenGL/miniaudio convention:

  • +X = Right, +Y = Up, -Z = Forward

For 2D games (Node2D): Simply use z=0:

Vec3 audio_pos(node2d_pos.x, node2d_pos.y, 0.0f);
void SetListenerPosition(const Vec3 &position, uint32_t listenerIndex=0)
Set the listener position in 3D space.
Definition audio_manager.cpp:632
3D vector for spatial audio positioning
Definition vec3.h:46

To use with game engines (e.g., Basilisk Engine nodes): Simply convert your engine's position vector to Vec3:

auto node_pos = camera_node.get_position();
Vec3 audio_pos(node_pos.x, node_pos.y, node_pos.z);

Performance: This method is optimized to skip updates when the position hasn't changed, so it's safe to call every frame. The mutex overhead is minimal, and spatial audio requires frequent updates for accurate positioning.

Parameters
position3D position of the listener
listenerIndexIndex of the listener (default 0)

◆ SetListenerUp()

void audio::AudioManager::SetListenerUp ( const Vec3 up,
uint32_t  listenerIndex = 0 
)

Set the listener up vector.

The up vector defines the orientation of the listener. Typically (0, 1, 0) for a standard Y-up coordinate system.

Parameters
upUp vector (should be normalized)
listenerIndexIndex of the listener (default 0)

◆ SetLogLevel()

void audio::AudioManager::SetLogLevel ( LogLevel  level)
static

Set the global audio log level (runtime).

Logging defaults to Off. Use this method to enable logging output.

◆ SetMasterVolume()

void audio::AudioManager::SetMasterVolume ( float  volume)

Set the master volume for all audio.

Parameters
volumeVolume level (0.0 to 1.0)

◆ SetSoundLooping()

void audio::AudioManager::SetSoundLooping ( SoundHandle  sound,
bool  should_loop 
)

Set whether a sound should loop.

Parameters
soundHandle to the sound
should_loopWhether the sound should loop continuously
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundMaxDistance()

void audio::AudioManager::SetSoundMaxDistance ( SoundHandle  sound,
float  maxDistance 
)

Set the maximum distance for distance attenuation.

At distances beyond maxDistance, the sound will be at minimum gain.

Parameters
soundHandle to the sound
maxDistanceMaximum distance (must be > minDistance)
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundMinDistance()

void audio::AudioManager::SetSoundMinDistance ( SoundHandle  sound,
float  minDistance 
)

Set the minimum distance for distance attenuation.

At distances less than minDistance, the sound will be at full volume. Beyond minDistance, volume will attenuate based on the attenuation model.

Parameters
soundHandle to the sound
minDistanceMinimum distance (must be > 0)
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundPitch()

void audio::AudioManager::SetSoundPitch ( SoundHandle  sound,
float  pitch 
)

Set the pitch of a sound for its next playback.

Parameters
soundHandle to the sound
pitchPitch multiplier (1.0 = normal, 0.5 = half speed, 2.0 = double speed)

◆ SetSoundPosition()

void audio::AudioManager::SetSoundPosition ( SoundHandle  sound,
const Vec3 position 
)

Set the 3D position of a sound.

Sets the position for the sound. The sound will be spatialized relative to the listener position.

Coordinate System: Uses OpenGL/miniaudio convention:

  • +X = Right, +Y = Up, -Z = Forward

For 2D games (Node2D): Simply use z=0:

Vec3 audio_pos(node2d_pos.x, node2d_pos.y, 0.0f);
SetSoundPosition(sound, audio_pos);
void SetSoundPosition(SoundHandle sound, const Vec3 &position)
Set the 3D position of a sound.
Definition audio_manager.cpp:677

To use with game engines (e.g., Basilisk Engine nodes): Simply convert your engine's node position to Vec3:

auto node_pos = game_object.get_position();
Vec3 audio_pos(node_pos.x, node_pos.y, node_pos.z);
SetSoundPosition(sound, audio_pos);
Parameters
soundHandle to the sound
position3D position of the sound
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundRolloff()

void audio::AudioManager::SetSoundRolloff ( SoundHandle  sound,
float  rolloff 
)

Set the rolloff factor for distance attenuation.

Higher values mean faster volume dropoff with distance. Typical values: 1.0 (linear), 2.0 (inverse square)

Parameters
soundHandle to the sound
rolloffRolloff factor (typically 1.0 to 2.0)
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundSpatializationEnabled()

void audio::AudioManager::SetSoundSpatializationEnabled ( SoundHandle  sound,
bool  enabled 
)

Enable or disable spatialization for a sound.

Parameters
soundHandle to the sound
enabledWhether to enable spatialization
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ SetSoundVolume()

void audio::AudioManager::SetSoundVolume ( SoundHandle  sound,
float  volume 
)

Set the volume of a sound.

Parameters
soundHandle to the sound
volumeVolume level (0.0 to 1.0)
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ Shutdown()

void audio::AudioManager::Shutdown ( )

Shut down the audio system.

This function cleans up all audio resources and shuts down the miniaudio engine. It should be called before application exit.

◆ StopSound()

void audio::AudioManager::StopSound ( SoundHandle  sound)

Stop a currently playing sound.

Parameters
soundHandle to the sound to stop
Exceptions
InvalidHandleExceptionIf the sound handle is invalid

◆ StopTrack()

void audio::AudioManager::StopTrack ( TrackHandle  track)

Stop playing an audio track.

All layers in the track will stop playing.

Parameters
trackHandle to the track to stop
Exceptions
InvalidHandleExceptionIf the track handle is invalid

Member Data Documentation

◆ audio_system_

unique_ptr<AudioSystem> audio::AudioManager::audio_system_
private

Core audio system.

◆ folder_sounds_

unordered_map<string, std::vector<SoundHandle> > audio::AudioManager::folder_sounds_
private

Cached sounds per folder.

◆ groups_

unordered_map<GroupHandle, unique_ptr<AudioGroup> > audio::AudioManager::groups_
private

Group storage.

◆ next_group_handle_

atomic<uint32_t> audio::AudioManager::next_group_handle_ {1}
private

Counter for generating unique group handles.

◆ next_sound_handle_

atomic<uint32_t> audio::AudioManager::next_sound_handle_ {1}
private

Counter for generating unique sound handles.

◆ next_track_handle_

atomic<uint32_t> audio::AudioManager::next_track_handle_ {1}
private

Counter for generating unique track handles.

◆ resource_mutex_

mutex audio::AudioManager::resource_mutex_
mutableprivate

Mutex for thread-safe resource access (mutable for const methods)

◆ rng_

std::mt19937 audio::AudioManager::rng_ {std::random_device{}()}
private

RNG for random playback.

◆ running_

atomic<bool> audio::AudioManager::running_ {false}
private

Flag indicating if audio system is running.

◆ sounds_

unordered_map<SoundHandle, unique_ptr<Sound> > audio::AudioManager::sounds_
private

Sound storage.

◆ tracks_

unordered_map<TrackHandle, unique_ptr<AudioTrack> > audio::AudioManager::tracks_
private

Track storage.

◆ update_thread_

thread audio::AudioManager::update_thread_
private

Thread for audio updates.


The documentation for this class was generated from the following files: