15#include <SFML/Audio.hpp>
31 _sound.setVolume(100.f);
37 return _buffer.isReady();
55 _sound.setVolume(volume * 100.f);
59 return _sound.getVolume() * 0.01f;
65 _sound.setPosition({
static_cast<float>(position.
x),
static_cast<float>(position.
y),
static_cast<float>(position.
z)});
Sfml SoundBuffer class - owns the loaded samples. SfmlSound only references it (sf::Sound itself alre...
Definition SfmlSoundBuffer.hpp:28
void setVolume(float volume) override
set the volume of the sound
Definition SfmlSound.hpp:54
Vector3f getPosition() const override
get the 3D position of the sound
Definition SfmlSound.hpp:67
void setVelocity(Vector3f velocity) override
set the velocity of the sound, used by backends that apply a doppler effect
Definition SfmlSound.hpp:72
void pause() override
Suspends the sound without touching the position.
Definition SfmlSound.hpp:46
void stop() override
Stops the sound AND rewinds to zero.
Definition SfmlSound.hpp:50
SfmlSound(SfmlSoundBuffer &buffer)
Definition SfmlSound.hpp:30
float getVolume() const override
get the volume of the sound
Definition SfmlSound.hpp:58
bool isReady() const override
Definition SfmlSound.hpp:36
~SfmlSound() override=default
void setPosition(Vector3f position) override
set the 3D position of the sound, for backends that spatialize against a listener....
Definition SfmlSound.hpp:63
void play() override
Fires the sound from the beginning.
Definition SfmlSound.hpp:40
Vector3f getVelocity() const override
get the velocity of the sound
Definition SfmlSound.hpp:75
Vector3< double > Vector3f
Definition Vector3.hpp:121
T x
Definition Vector3.hpp:21
T y
Definition Vector3.hpp:21
T z
Definition Vector3.hpp:21