Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error: "Failed to open sound file"". Windows 10 64bit VS2019 Community  (Read 172 times)

0 Members and 1 Guest are viewing this topic.

AdamHarris

  • Newbie
  • *
  • Posts: 1
    • View Profile
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9670
    • View Profile
    • development blog
    • Email
Re: Error: "Failed to open sound file"". Windows 10 64bit VS2019 Community
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

 

anything