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

Author Topic: Failed to open the audio device  (Read 3949 times)

0 Members and 3 Guests are viewing this topic.

glu4it

  • Newbie
  • *
  • Posts: 9
    • View Profile
Failed to open the audio device
« on: December 11, 2013, 12:29:37 pm »
Here is my code:
#include <SFML/Audio.hpp>

int main () {
sf::Music Music;
return 0;
}
 
I use Windows 8.1, sfml 2.1. Also i tried it on Windows 7.
and whenever I create my music file I get an error in the console window that says

"Failed to open the audio device"

I've added the audio to the linker.
Graphics and stuff work fine. I just started on music today and now I can't figure out the problem.
Help me please!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failed to open the audio device
« Reply #1 on: December 11, 2013, 12:43:56 pm »
Hmmm, I've only heard of this issue with SFML 1.6, but you still might try to apply similar fixes (you can find other posts here).

Try updating your audio card's driver from the manufacturer's website.
Make sure you copy the OpenAL dll next to your executable, that way you ensure the DLL that ships with SFML gets used and not a random on in PATH.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

glu4it

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Failed to open the audio device
« Reply #2 on: December 11, 2013, 01:01:14 pm »
Hmmm, I've only heard of this issue with SFML 1.6, but you still might try to apply similar fixes (you can find other posts here).

Try updating your audio card's driver from the manufacturer's website.
Make sure you copy the OpenAL dll next to your executable, that way you ensure the DLL that ships with SFML gets used and not a random on in PATH.
All the drivers are the latest. OpenAL32.dll I added to project's directory and to Debug directory. But it still doesn't work :(

glu4it

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Failed to open the audio device
« Reply #3 on: December 11, 2013, 01:14:36 pm »
Promblem is solved!)
I used wrong openal32.dll and libsndfile-1.dll, so I change it to dlls from SFML directory and now it works. Thank you!