32 AudioSource(
const std::string& soundFile,
float x,
float y,
float z);
39 AudioSource(
const std::string& soundFile,
const glm::vec3& pos);
125 bool loadWavFile(
const std::string& filename, ALuint buffer);
128 std::vector<ALuint> buffers;
130 ALuint currentBufferIndex = 0;
131 ALuint currentSource = 0;
133 bool playing =
false;
AudioSource class to play sound effects.
Definition audioSource.h:17
AudioSource(const std::string &soundFile)
Constructs an AudioSource object with the specified sound file.
Definition audioSource.cpp:10
AudioSource * setValue(float value)
Set the value of the AudioSource.
Definition audioSource.cpp:92
AudioSource * loop(bool shouldLoop)
Sets whether the audio should loop.
Definition audioSource.cpp:64
void release()
Releases resources associated with the AudioSource.
Definition audioSource.cpp:36
void play()
Plays the audio.
Definition audioSource.cpp:43
glm::vec3 getPosition() const
Gets the position of the AudioSource.
Definition audioSource.cpp:112
void pause()
Pauses the audio.
Definition audioSource.cpp:50
void stop()
Stops the audio.
Definition audioSource.cpp:57
AudioSource * spatial(bool isSpatial)
Sets whether the audio should be spatial.
Definition audioSource.cpp:71
AudioSource * setPosition(float x, float y, float z)
Sets the position of the AudioSource.
Definition audioSource.cpp:79
AudioSource * setExponentialDistanceModel(float refDistance, float rollFactor)
Set the distance model to exponential.
Definition audioSource.cpp:104
AudioSource * setLinearDistanceModel()
Set the distance model to linear.
Definition audioSource.cpp:98