SFML community forums

Help => Audio => Topic started by: supperpiccle on July 03, 2012, 05:42:36 pm

Title: Failed to open Audio Device
Post by: supperpiccle on July 03, 2012, 05:42:36 pm
I just started trying to learn Audio in sfml today.  The graphics work fine although i had to download all the dlls online as i did with the audio part of sfml too.  Everytime i try to open a sound it gives the messege in the console failed to open audio device.  What does this mean how do I fix it.  I'm running code blocks too btw.  I have included the audio stuff in the compiler stuff too
Title: Re: Failed to open Audio Device
Post by: mimipim on July 03, 2012, 05:46:03 pm
You have to be more clear.
Which version of SFML are you using, well how you load the audio and make sure the path to the audio is correct.

EDIT:
What you mean with that you get the dll online?
Title: Re: Failed to open Audio Device
Post by: supperpiccle on July 03, 2012, 05:49:44 pm
I'm sorry I'm using sfml 1.6 here is my code


#include <SFML/Audio.hpp>
#include <SFML/System.hpp>
#include <Windows.h>
#include <iostream>

using namespace std;
int main()
{
    int c;
    sf::SoundBuffer Buffer;
    Buffer.LoadFromFile("beep-8.wav");
    sf::Sound Sound;
    Sound.SetBuffer(Buffer);
    Sound.SetLoop(true);
    Sound.Play();
    cout<<"here";
cin>>c;
}

I downloaded all the audio dlls from the same website that gave me the graphics dlls and graphics work.....Just not this i added the link stuff at link settings in code blocks
Title: Re: Failed to open Audio Device
Post by: eXpl0it3r on July 03, 2012, 07:03:50 pm
There's a code that and there's even a code=cpp tag, which will magically highlight your code... ::)

I highly recommend not to use SFML 1.6 since it's outdated and SFML 2 is already in RC state. You can download it here (http://www.sfml-dev.org/download.php#2.0-rc) (so you don't need some strange website or so).

Are your audio devices working, i.e. can you listen to music with any music player?
Title: Re: Failed to open Audio Device
Post by: Yukilay on January 25, 2013, 08:17:13 pm
Hi all, I'm new here.

I'm learning to use SFML and I've got the same problem than you. I just try to compile the 'sound' sample that full SDK provide us and it doesn't work.

I usually speak in Skype and listen my music in Windows Media Player, so it isn't a sound card problem I guess.

I'm using Windows 7, CodeBlocks 12.11 with MinGW and SFML 1.6 because I would prefer 2.0 release isn't Beta version and I don't know if it's stable.

I hope you can help me! =)

Thanks
Title: Re: Failed to open Audio Device
Post by: eXpl0it3r on January 25, 2013, 10:28:24 pm
I usually speak in Skype and listen my music in Windows Media Player, so it isn't a sound card problem I guess.
What's your audio setup?
Do you have multiple audio cards? Are you running an application, which can take over the full audio card? Is the audio card driver uptodate?

I'm using Windows 7, CodeBlocks 12.11 with MinGW and SFML 1.6 because I would prefer 2.0 release isn't Beta version and I don't know if it's stable.
Then you should look at the FAQ, e.g. here (https://github.com/SFML/SFML/wiki/FAQ#wiki-grl-version).
Title: Re: Failed to open Audio Device
Post by: Yukilay on January 26, 2013, 07:27:48 pm
Well, I have the Asus Sabertooth X58 motherboard and any sound cards more.

In other hand, I've just read the FAQ and I think I will develop with SFML 2.0. It seems there won't be problems from Beta to Release. I will try if it works now...

Thanks.
Title: Re: Failed to open Audio Device
Post by: Yukilay on January 28, 2013, 01:53:11 am
Finally, I downloaded SFML 2.0 (SJLJ), I changed the necessary member function to adapt my code and it works now. I don't know what was happening with 1.6, by the way.

Thanks again :)