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 memory.
-
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, int 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, unsigned long int bufferSize) -> bool
- Loads samples in raw PCM format from a memory buffer.
- auto bufferId() const -> unsigned int
- Returns the OpenAL buffer id.
- auto bytesPerSample() const -> int
- Returns the number of bytes per sample.
- auto numChannels() const -> int
- Returns the number of audio channels.
- auto frequency() const -> int
- Returns the samples frequency.
- auto numSamples() const -> unsigned long int
- Returns number of samples.
- auto duration() const -> float
- Returns the duration in seconds.
- auto bufferSize() const -> unsigned long
- Returns the size of the buffer in bytes.
Function documentation
nCine:: AudioBuffer:: AudioBuffer(StringView filename) explicit
A constructor creating a buffer from memory.
A constructor creating a buffer from a file