AudioContext class
#include <core/al/audio_context.hpp>
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
- auto getMaxListenerCount() const -> int pure virtual
- Gets the maximum number of listeners supported by the audio context.
- 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.
- auto getDefaultDevice() -> std::string pure virtual
- Gets the default audio device.
Function documentation
static std::shared_ptr<AudioContext> cubos:: core:: al:: AudioContext:: create()
Creates an audio context.
| Returns | AudioContext, or nullptr on failure. |
|---|
int cubos:: core:: al:: AudioContext:: getMaxListenerCount() const pure virtual
Gets the maximum number of listeners supported by the audio context.
| Returns | Maximum number of listeners. |
|---|
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. |
std::string cubos:: core:: al:: AudioContext:: getDefaultDevice() pure virtual
Gets the default audio device.
| Returns | Name of the default audio device. |
|---|