class
#include <core/al/audio_context.hpp>
Source Abstract audio source.
Public functions
-
void setBuffer(cubos::
core:: al:: Buffer buffer) pure virtual - Sets the buffer to be played by the source.
- void setPosition(const glm::vec3& position) pure virtual
- Sets the position of the source, by default, in the world space.
- void setVelocity(const glm::vec3& velocity) pure virtual
- Sets the velocity of the source, by default, in the world space.
- void setGain(float gain) pure virtual
- Sets the gain of the source.
- void setPitch(float pitch) pure virtual
- Sets the pitch of the source.
- void setLooping(bool looping) pure virtual
- Sets whether the source plays in a loop.
-
void setRelative(cubos::
core:: al:: Listener listener) pure virtual - Sets whether the source position and velocity is relative to the listener or not.
- void setMaxDistance(float maxDistance) pure virtual
- Sets the maximum distance at which the source is audible.
- void setMinDistance(float minDistance) pure virtual
- Sets the minimum distance at which the source starts to attenuate.
- void setCone(float innerAngle, float outerAngle, float outerGain) pure virtual
- Sets the cone angle, in degrees. While also setting the outerGain.
- void setConeDirection(const glm::vec3& direction) pure virtual
- Sets the cone direction of the source.
- void play() pure virtual
- Plays the source.
Function documentation
void cubos:: core:: al:: impl:: Source:: setBuffer(cubos:: core:: al:: Buffer buffer) pure virtual
Sets the buffer to be played by the source.
Parameters | |
---|---|
buffer | Buffer. |
void cubos:: core:: al:: impl:: Source:: setPosition(const glm::vec3& position) pure virtual
Sets the position of the source, by default, in the world space.
Parameters | |
---|---|
position | Position. |
void cubos:: core:: al:: impl:: Source:: setVelocity(const glm::vec3& velocity) pure virtual
Sets the velocity of the source, by default, in the world space.
Parameters | |
---|---|
velocity | Velocity. |
void cubos:: core:: al:: impl:: Source:: setGain(float gain) pure virtual
Sets the gain of the source.
Parameters | |
---|---|
gain | Gain. |
void cubos:: core:: al:: impl:: Source:: setPitch(float pitch) pure virtual
Sets the pitch of the source.
Parameters | |
---|---|
pitch | Pitch. |
void cubos:: core:: al:: impl:: Source:: setLooping(bool looping) pure virtual
Sets whether the source plays in a loop.
Parameters | |
---|---|
looping | Looping flag. |
void cubos:: core:: al:: impl:: Source:: setMaxDistance(float maxDistance) pure virtual
Sets the maximum distance at which the source is audible.
Parameters | |
---|---|
maxDistance | Maximum distance. |
void cubos:: core:: al:: impl:: Source:: setMinDistance(float minDistance) pure virtual
Sets the minimum distance at which the source starts to attenuate.
Parameters | |
---|---|
minDistance | Minimum distance. |
void cubos:: core:: al:: impl:: Source:: setCone(float innerAngle,
float outerAngle,
float outerGain) pure virtual
Sets the cone angle, in degrees. While also setting the outerGain.
Parameters | |
---|---|
innerAngle | Outer angle, in degrees. |
outerAngle | Inner angle, in degrees. |
outerGain |
void cubos:: core:: al:: impl:: Source:: setConeDirection(const glm::vec3& direction) pure virtual
Sets the cone direction of the source.
Parameters | |
---|---|
direction | Direction. |