class
#include <nCine/Audio/AudioBuffer.h>
AudioBuffer OpenAL audio buffer.
It inherits from Object
because a buffer can be shared by more than one AudioBufferPlayer
object.
Base classes
- class Object
- Base class of nCine objects.
Public types
Public static functions
- static auto sType() -> ObjectType
Constructors, destructors, conversion operators
- AudioBuffer()
- Creates an OpenAL buffer name.
- AudioBuffer(StringView filename) explicit
- A constructor creating a buffer from a file.
-
AudioBuffer(std::
unique_ptr<Death:: IO:: Stream> fileHandle, StringView filename) - ~AudioBuffer() override
- AudioBuffer(const AudioBuffer&) deleted
- AudioBuffer(AudioBuffer&& other) noexcept
Public functions
- auto operator=(const AudioBuffer&) -> AudioBuffer& deleted
- auto operator=(AudioBuffer&& other) -> AudioBuffer& noexcept
-
void init(Format format,
std::
int32_t frequency) - Initializes an empty buffer with the specified format and frequency.
- auto loadFromFile(StringView filename) -> bool
-
auto loadFromStream(std::
unique_ptr<Death:: IO:: Stream> fileHandle, StringView filename) -> bool -
auto loadFromSamples(const unsigned char* bufferPtr,
std::
int32_t bufferSize) -> bool - Loads samples in raw PCM format from a memory buffer.
-
auto bufferId() const -> std::
uint32_t - Returns the OpenAL buffer id.
-
auto bytesPerSample() const -> std::
int32_t - Returns the number of bytes per sample.
-
auto numChannels() const -> std::
int32_t - Returns the number of audio channels.
-
auto frequency() const -> std::
int32_t - Returns the samples frequency.
-
auto numSamples() const -> std::
int32_t - Returns number of samples.
- auto duration() const -> float
- Returns the duration in seconds.
-
auto bufferSize() const -> std::
int32_t - Returns the size of the buffer in bytes.