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

Author Topic: Delays / program locks after playing sounds  (Read 27061 times)

0 Members and 2 Guests are viewing this topic.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Delays / program locks after playing sounds
« on: June 04, 2008, 12:14:23 am »
I recently added some sounds to my current project and noticed that there were some very brief delays in my display and then several seconds later a much longer pause  - basically the program locks up for a few seconds. It was very noticeable as it's a scrolling 3D view drawn with OpenGL. I'm tried WAV and OGG files and the result is the same. The sounds themselves seem to play fine.

I've tried adding a simple sound to play in the SFML OpenGL example of the white cube and got the same results. I added these lines just before the start game loop:

sf::SoundBuffer doorBuffer;
sf::Sound doorSound;
doorBuffer.LoadFromFile("datas/audio/door.wav");
doorSound.SetBuffer(doorBuffer);
doorSound.Play();

I'm using Windows XP, the latest SVN and Visual Studio. I haven't had the chance to test this on another PC yet.

Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Delays / program locks after playing sounds
« Reply #1 on: June 04, 2008, 09:53:48 am »
That's weird. I'll check this as soon as possible, thanks for the feedback.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Delays / program locks after playing sounds
« Reply #2 on: June 11, 2008, 04:41:53 pm »
I've tried your code in the OpenGL sample, and couldn't reproduce the bug.

Can you try again with the latest SVN, and footsteps.wav from the samples data ?
Laurent Gomila - SFML developer

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Delays / program locks after playing sounds
« Reply #3 on: June 14, 2008, 09:45:12 am »
Quote from: "Laurent"
I've tried your code in the OpenGL sample, and couldn't reproduce the bug.

Can you try again with the latest SVN, and footsteps.wav from the samples data ?


I've updated to the latest SVN and tried the footsteps.wav file and I get the same result. As far as I can see I'm using the most recent verions of everything.

I've tried a few different sound files and it appears that the freeze appears about 20 seconds after the sound finishes playing. I also tried this on another PC and had the same result.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Delays / program locks after playing sounds
« Reply #4 on: June 14, 2008, 10:56:57 am »
Which version of SFML are you using ? Debug / release ? Static / dynamic ?
Which version of Visual Studio ?

I still can't reproduce the bug, although I'm using the exact same configuration and code as you.
Laurent Gomila - SFML developer

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Delays / program locks after playing sounds
« Reply #5 on: June 14, 2008, 11:43:10 am »
Quote from: "Laurent"
Which version of SFML are you using ? Debug / release ? Static / dynamic ?
Which version of Visual Studio ?

I still can't reproduce the bug, although I'm using the exact same configuration and code as you.


I'm using the latest SVN. I had previously used 1.2 and experienced the same problem. I'm using debug mode with I think dynamic libraries (I need to include the SFML DLLs in my project folder in order to run my executable).

The following libraries are in the project settings:

sfml-system-d.lib sfml-window-d.lib sfml-graphics-d.lib sfml-audio-d.lib opengl32.lib glu32.lib

I'll try release / static.

Thanks.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Delays / program locks after playing sounds
« Reply #6 on: June 14, 2008, 11:51:50 am »
... and Visual Studio 2005 Professional with C++.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Delays / program locks after playing sounds
« Reply #7 on: June 14, 2008, 12:34:24 pm »
Ok, let me know if there's a difference with static libraries.
Laurent Gomila - SFML developer

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Delays / program locks after playing sounds
« Reply #8 on: June 17, 2008, 11:54:14 pm »
Quote from: "Laurent"
Ok, let me know if there's a difference with static libraries.


After more tests with different PCs and the different libraries it seems to have been some strange combination problem with my Visual Studio setup / libraries on my main PC rather than SFML. Sorry. Thanks for your looking into this.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Delays / program locks after playing sounds
« Reply #9 on: June 18, 2008, 03:06:58 am »
Ok, that's a good news :)
Laurent Gomila - SFML developer

 

anything