Hello,
In my actual project where I use SFML 3 I try to add some sound effects, actually music works but when I try to play a sound nothing happen.
I've tested several ways and places, I have checked the path of the file is ok, I have no compile errors, and the file open well in a media player (VLC) and I've tried with .wav, .ogg and .mp3 files too.
The game run and don't crash, just no sound effect when it may be have one.
The code I've used is in on case :
sf::SoundBuffer buffer("Assets/Sounds/rebond_SFX.ogg");
sf::Sound rebond = sf::Sound(buffer);
rebond.play();In others :
//buffer is declared in the header file of the class
if (this->buffer.loadFromFile("Assets/Sounds/rebond_SFX.ogg")) {
sf::Sound rebond = sf::Sound(this->buffer);
rebond.play();
}I have tried to add some libraries just to test :
SFML::Graphics SFML::Audio FLAC::FLAC Vorbis::vorbis Vorbis::vorbisenc Vorbis::vorbis Ogg::oggI don't know what to do more now.
If someone have an idea I'm listening 🙂
Thanks for your help,
Have a nice day.