cubos::core::al::AudioContext class

Audio context that contains audio devices;.

Derived classes

class MiniaudioContext
Audio device implementation using miniaudio.

Public static functions

static auto create() -> std::shared_ptr<AudioContext>
Creates an audio context.

Public functions

void enumerateDevices(std::vector<std::string>& devices) pure virtual
Enumerates the available devices.
auto createDevice(unsigned int listenerCount, const std::string& specifier = "") -> AudioDevice pure virtual
Creates a new audio device.
auto createBuffer(const void* data, size_t dataSize) -> Buffer pure virtual
Creates a new audio buffer.

Function documentation

static std::shared_ptr<AudioContext> cubos::core::al::AudioContext::create()

Creates an audio context.

Returns AudioContext, or nullptr on failure.

void cubos::core::al::AudioContext::enumerateDevices(std::vector<std::string>& devices) pure virtual

Enumerates the available devices.

Parameters
devices out Vector to fill with the available device's specifiers.

AudioDevice cubos::core::al::AudioContext::createDevice(unsigned int listenerCount, const std::string& specifier = "") pure virtual

Creates a new audio device.

Parameters
listenerCount Number of audio listeners to be supported by the device.
specifier Identifier of the audio device.
Returns Handle of the new device

Buffer cubos::core::al::AudioContext::createBuffer(const void* data, size_t dataSize) pure virtual

Creates a new audio buffer.

Parameters
data Data to be written to the buffer, either .wav, .mp3 or .flac.
dataSize Size of the data to be written.
Returns Handle of the new buffer.