SFML community forums

Help => Audio => Topic started by: AdamHarris on September 25, 2020, 06:40:14 pm

Title: Error: "Failed to open sound file"". Windows 10 64bit VS2019 Community
Post by: AdamHarris on September 25, 2020, 06:40:14 pm
Hi everyone, I have encountered an issue with my code which is the .wav file I am loading and all .wav files I try to load are failing to load with the error, "Failed to open sound file"". With that exact error, there is no path given which seems odd if that is intended. Anyway here is the code;

sf::SoundBuffer buffer;
sf::Sound scoreSound;
if (!buffer.loadFromFile("paddlehit.wav")) {
std::cout << "Failed to load file" << std::endl;
}
scoreSound.setBuffer(buffer);
 

In my linker input settings is this
openal32.lib;sfml-graphics.lib;sfml-window.lib;sfml-system.lib;sfml-audio.lib;%(AdditionalDependencies)

all of the DLLs are inside of my working directory and all of the lib and include files were directly copied from the downloaded SFML folder into the corresponding directories in my project "SFML/lib" and "SFML/include/SFML"

Any help would be much appreciated.
Title: Re: Error: "Failed to open sound file"". Windows 10 64bit VS2019 Community
Post by: eXpl0it3r on September 25, 2020, 07:23:56 pm
You are probably mixing debug and release mode. Make sure you link debug libraries im debug mode and release libraries in release mode.