class
#include <core/al/audio_device.hpp>
AudioDevice Audio device interface used to wrap low-level audio rendering APIs.
Public static functions
- static auto create(const std::string& specifier = "") -> std::shared_ptr<AudioDevice>
- Creates an audio device from a given device
specifier
. - static void enumerateDevices(std::vector<std::string>& devices)
- Enumerates the available devices.
Constructors, destructors, conversion operators
- AudioDevice(const AudioDevice&) deleted
- Forbid copy construction.
Public functions
- auto createBuffer() -> Buffer pure virtual
- Creates a new audio buffer.
- auto createSource() -> Source pure virtual
- Creates a new audio source.
- void setListenerPosition(const glm::vec3& position) pure virtual
- Sets the position of the listener.
- void setListenerOrientation(const glm::vec3& forward, const glm::vec3& up) pure virtual
- Sets the orientation of the listener.
- void setListenerVelocity(const glm::vec3& velocity) pure virtual
- Sets the velocity of the listener. Used to implement the doppler effect.
Function documentation
static std::shared_ptr<AudioDevice> cubos:: core:: al:: AudioDevice:: create(const std::string& specifier = "")
Creates an audio device from a given device specifier
.
Parameters | |
---|---|
specifier | Device specifier (empty for default). |
Returns | Audio device, or nullptr on failure. |
static void cubos:: core:: al:: AudioDevice:: enumerateDevices(std::vector<std::string>& devices)
Enumerates the available devices.
Parameters | |
---|---|
devices out | Vector to fill with the available devices. |
Buffer cubos:: core:: al:: AudioDevice:: createBuffer() pure virtual
Creates a new audio buffer.
Returns | Handle of the new buffer. |
---|
Source cubos:: core:: al:: AudioDevice:: createSource() pure virtual
Creates a new audio source.
Returns | Handle of the new source. |
---|
void cubos:: core:: al:: AudioDevice:: setListenerPosition(const glm::vec3& position) pure virtual
Sets the position of the listener.
Parameters | |
---|---|
position | Position. |
void cubos:: core:: al:: AudioDevice:: setListenerOrientation(const glm::vec3& forward,
const glm::vec3& up) pure virtual
Sets the orientation of the listener.
Parameters | |
---|---|
forward | Forward direction of the listener. |
up | Up direction of the listener. |
void cubos:: core:: al:: AudioDevice:: setListenerVelocity(const glm::vec3& velocity) pure virtual
Sets the velocity of the listener. Used to implement the doppler effect.
Parameters | |
---|---|
velocity | Velocity of the listener. |