Magnum::Audio::Renderer class

Global renderer configuration.

Public types

enum class Error: ALenum { NoError = AL_NO_ERROR, InvalidName = AL_INVALID_NAME, InvalidEnum = AL_INVALID_ENUM, InvalidValue = AL_INVALID_VALUE, InvalidOperation = AL_INVALID_OPERATION, OutOfMemory = AL_OUT_OF_MEMORY }
Error status.

Public static functions

static auto error() -> Error
Error status.

Listener positioning

static auto listenerPosition() -> Vector3
Listener position.
static void setListenerPosition(const Vector3& position)
Set listener position.
static void setListenerPosition(const Vector3i& position)
static auto listenerOrientation() -> std::array<Vector3, 2>
Listener orientation.
static void setListenerOrientation(const Vector3& forward, const Vector3& up)
Set listener orientation.
static void setListenerOrientation(const Vector3i& forward, const Vector3i& up)
static auto listenerVelocity() -> Vector3
Listener position.
static void setListenerVelocity(const Vector3& velocity)
Set listener velocity.
static void setListenerVelocity(const Vector3i& velocity)

Global behavior

enum class DistanceModel: ALenum { None = AL_NONE, Inverse = AL_INVERSE_DISTANCE, InverseClamped = AL_INVERSE_DISTANCE_CLAMPED, Linear = AL_LINEAR_DISTANCE, LinearClamped = AL_LINEAR_DISTANCE_CLAMPED, Exponent = AL_EXPONENT_DISTANCE, ExponentClamped = AL_EXPONENT_DISTANCE_CLAMPED }
Distance model.
static auto listenerGain() -> Float
Listener gain.
static void setListenerGain(Float gain)
Set listener gain.
static auto dopplerFactor() -> Float
Doppler factor.
static void setDopplerFactor(Float factor)
Set Doppler factor.
static auto speedOfSound() -> Float
Speed of sound.
static void setSpeedOfSound(Float speed)
Set speed of sound.
static auto distanceModel() -> DistanceModel
Distance model.
static void setDistanceModel(DistanceModel model)
Set distance model.

Enum documentation

enum class Magnum::Audio::Renderer::Error: ALenum

Error status.

Enumerators
NoError

No error occurred

InvalidName

Invalid name parameter

InvalidEnum

Invalid enum parameter

InvalidValue

Invalid enum value parameter

InvalidOperation

Illegal call

OutOfMemory

Unable to allocate memory

enum class Magnum::Audio::Renderer::DistanceModel: ALenum

Distance model.

Enumerators
None

No distance attenuation calculation

Inverse

Inverse distance

InverseClamped

Inverse distance, clamped

Linear

Linear distance

LinearClamped

Linear distance, clamped

Exponent

Exponential distance

ExponentClamped

Exponential distance, clamped

Function documentation

static Vector3 Magnum::Audio::Renderer::listenerPosition()

Listener position.

static void Magnum::Audio::Renderer::setListenerPosition(const Vector3& position)

Set listener position.

Default is {0.0f, 0.0f, 0.0f}.

static void Magnum::Audio::Renderer::setListenerPosition(const Vector3i& position)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static std::array<Vector3, 2> Magnum::Audio::Renderer::listenerOrientation()

Listener orientation.

The returned array consists of forward (index 0) and up (index 1) vectors.

static void Magnum::Audio::Renderer::setListenerOrientation(const Vector3& forward, const Vector3& up)

Set listener orientation.

The values must be linearly independent and don't need to be normalized. Default is -Z and +Y.

static void Magnum::Audio::Renderer::setListenerOrientation(const Vector3i& forward, const Vector3i& up)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static Vector3 Magnum::Audio::Renderer::listenerVelocity()

Listener position.

static void Magnum::Audio::Renderer::setListenerVelocity(const Vector3& velocity)

Set listener velocity.

Default is {0.0f, 0.0f, 0.0f}.

static void Magnum::Audio::Renderer::setListenerVelocity(const Vector3i& velocity)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static Float Magnum::Audio::Renderer::listenerGain()

Listener gain.

static void Magnum::Audio::Renderer::setListenerGain(Float gain)

Set listener gain.

Default is 1.0f, which means that the sound is unattenuated. If set to 0.0f, all sound is muted.

static Float Magnum::Audio::Renderer::dopplerFactor()

Doppler factor.

static void Magnum::Audio::Renderer::setDopplerFactor(Float factor)

Set Doppler factor.

Default is 1.0f. If set to 0.0f, the effect is disabled.

static Float Magnum::Audio::Renderer::speedOfSound()

Speed of sound.

static void Magnum::Audio::Renderer::setSpeedOfSound(Float speed)

Set speed of sound.

Default is 343.3f (meters per second).

static DistanceModel Magnum::Audio::Renderer::distanceModel()

Distance model.

static void Magnum::Audio::Renderer::setDistanceModel(DistanceModel model)

Set distance model.

Default is DistanceModel::InverseClamped.

Debug& operator<<(Debug& debug, Renderer::Error value)

Debug output operator.

Debug& operator<<(Debug& debug, Renderer::DistanceModel value)

Debug output operator.