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 - Blodyavenger

Pages: [1]
1
Audio / Re: Multiple Sounds problem | they don't play after time
« on: April 21, 2013, 08:01:29 pm »
Ok, buffers are loaded once on the start and destroyed once at the end. So this shouldn't be the issue. What if I call STOP on sound just before I delete it, is that fine?

Many people suggested to use smart pointers already so maybe I really should as soon as I can.

2
Audio / Multiple Sounds problem | they don't play after time
« on: April 21, 2013, 07:26:29 pm »
I've looked around the forum and I think there was no solution for my problem. So here it goes:

I have like 10 sounds playing at once like falling stones, water dripping, player steps, fire burning etc. I have this earthquake scene where stones are falling to the ground (each stone has it's own sf::Sound) and when it hits the ground, sound plays and then the object is destroyed. After time, I stop hearing stone sounds (not entirely, sound plays from time to time) and I'm not sure what I'm doing wrong.

  • I keep sound buffers in one array and I point sf::Sound to these
  • Objects with sound have static sf::Sound for member variable
  • Objects are allocated with new but I destroy them with delete

Is there a way to see how many sf::Sound instances are alive? Anything would help, thanks a lot!

Pages: [1]
anything