First post!
I'm using a CMake build of a recent SFML 2.0 development snapshot on Windows 7 Starter 32-bit (netbook... only while I'm out of my home country) in Code::Blocks 10.05 + MinGW.
I've tested every other SFML module besides Audio and they all worked flawlessly. I followed SFML Coder's Youtube tutorials and everything seems to be set up and working properly. I made sure to put the audio extlibs in my project folder as well.
However, when trying to perform even the most basic audio tasks, I get a weird exit status. Here is my test code:
#include <SFML/Audio.hpp>
int main()
{
sf::SoundBuffer Buffer;
if (!Buffer.loadFromFile("sound.ogg"))
{
return 1;
}
sf::Sound Sound(Buffer);
Sound.play();
while (Sound.getStatus() == sf::Sound::Playing)
{
sf::sleep(sf::seconds(1));
}
return 0;
}
The sound plays just fine and the program behaves as expected EXCEPT I keep getting this in the debug console:
Process returned -2147418113 (0x8000FFFF) execution time : 2.505 s
Press any key to continue.
And I get this in the build log:
Process terminated with status -2147418113 (1 minutes, 1 seconds)
*Note: The times are only different because I had to copy/paste text, not because there was a large delay in the program.*
I tried the exact tutorial sample program word for word (except for API changes since 1.6) and got the same exit code. I also tried with a longer music file and got the same results. I even tried just opening the sound file with the SoundBuffer constructor without even creating or playing the sf::Sound and I STILL got the error code, which suggests the problem is related to SoundBuffer.
HOWEVER, I did get a 0 exit status twice, once with the short sound effect and once with the music file, but haven't been able to reproduce them again, which makes me wonder if it's a concurrency issue. Still, it seems very strange that I got the bad exit status even when I didn't create a corresponding sf::Sound object.
I also apologize for not doing as thorough of an Internet search as usual because I'm currently in a place with very sparse Internet access and I have other things to take care of at the moment, so I decided to post while I can.
So I guess my questions are:
- Is this a known sf::SoundBuffer problem with a known solution?
- Am I / the tutorial missing something important like closing a file?
- Could this have something to do with being on a slow netbook?
- Does this appear to be a concurrency issue?
You don't have to answer all of those, I just wanted to get the discussion going. Thank you everybody for your help!