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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bambitheslug

Pages: [1]
1
Audio / Re: sf::SoundBuffer bad exit status
« on: July 28, 2012, 10:55:03 pm »
I've actually forgotten all about how to use GDB so I don't know how to trace the problem to the audio device deconstructor, but I also get the problem with that minimal code just creating an sf::Sound instance. I'm guessing it's the same problem. Anyway, since this won't be my main development PC, I won't worry about it until I get back home.

I don't know much since I'm brand new to SFML, but it seems from that link that there currently isn't a quality solution to the problem, right? It would be nice to have a good exit status, but it doesn't seem to interfere with the audio functionality of the program, so I guess it's just an annoyance more than anything. Anyway, I love SFML, it's by far the easiest library to build and use that I've ever tried! I'll definitely be using it more and more.

2
Audio / sf::SoundBuffer bad exit status
« on: July 28, 2012, 06:10:45 am »
First post!  ;D

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:

Code: [Select]

#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:

Code: [Select]


Process returned -2147418113 (0x8000FFFF)   execution time : 2.505 s
Press any key to continue.


And I get this in the build log:

Code: [Select]
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!

Pages: [1]