|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
Wrapper around an OpenAL audio buffer. More...
#include <headers/utility/sound/audio_buffer.hpp>
Public Member Functions | |
| AudioBuffer () | |
| Creates an empty audio buffer. | |
| ~AudioBuffer () | |
| Destroys the audio buffer and releases its OpenAL resource. | |
| ALuint | bufferID () const |
| Retrieves the underlying OpenAL buffer identifier. | |
| void | upload (const DecodedAudio &decodedAudio) |
| Uploads decoded audio data to the OpenAL buffer. | |
Wrapper around an OpenAL audio buffer.
AudioBuffer manages the lifetime of an OpenAL buffer object and provides a simple interface for uploading decoded PCM audio data.
The buffer is automatically released when the instance is destroyed.
Definition at line 39 of file audio_buffer.hpp.
| utility::sound::AudioBuffer::AudioBuffer | ( | ) |
Creates an empty audio buffer.
No OpenAL resource is allocated until upload() is called.
Definition at line 24 of file audio_buffer.cpp.
| utility::sound::AudioBuffer::~AudioBuffer | ( | ) |
Destroys the audio buffer and releases its OpenAL resource.
Definition at line 28 of file audio_buffer.cpp.
| ALuint utility::sound::AudioBuffer::bufferID | ( | ) | const |
Retrieves the underlying OpenAL buffer identifier.
Definition at line 33 of file audio_buffer.cpp.
| void utility::sound::AudioBuffer::upload | ( | const DecodedAudio & | decodedAudio | ) |
Uploads decoded audio data to the OpenAL buffer.
If a buffer already exists, it is deleted and recreated before uploading the new data.
| decodedAudio | Decoded PCM audio data and associated format information. |
Definition at line 38 of file audio_buffer.cpp.