Start by adding a sound object to manage its own sets of resources and APIs and using C++'s RAII to manage its own object destruction.
This will act as a wrapper around the miniaudio C API, using object-oriented design.
API Example
audio::sound test_sound("resources/elephant.wav");
test_sound.spatialization_enabled(p_bool);
test_sound.pinned_listener(uint32_t p_index);
test_sound.direction(float forward_x, float forward_y, float forward_z);
test_sound.attenuation_model(AL_INVERSE_DISTANCE_CLAMPED);
test_sound.position(float x, float y, float z);
test_sound.relative_position(ma_attenuation_model_inverse);
test_sound.fade(float p_vol_start, float p_vol_end, uint64_t p_fade_length);
test_sound.read_pcm_frames();
Expected Behavior
The expected behavior is to be able to communicate in a thread-safe manner and set parameters such as spatialization.
For more info, refer to this link.
Start by adding a sound object to manage its own sets of resources and APIs and using C++'s RAII to manage its own object destruction.
This will act as a wrapper around the miniaudio C API, using object-oriented design.
API Example
Expected Behavior
The expected behavior is to be able to communicate in a thread-safe manner and set parameters such as spatialization.
For more info, refer to this link.