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

Pages: [1]
1
Audio / Re: Recycle Sound Players Using Callback
« on: March 04, 2014, 12:09:04 am »
That is certainly better than my workaround because it only runs once when a new sound needs to play.

I still think a callback would be better to put things in constant time, but this solution works for me because the number of players will not be too ridiculous in my case, neither should the number of sounds played simultaneously. So the fact that this solution deals in linear time is a non-issue, at least in this case.

Thanks Laurent!

2
Audio / Recycle Sound Players Using Callback
« on: March 03, 2014, 10:10:57 pm »
Hi! I am new to SFML. My only audio experience to this point is OpenSL ES on Android. I am trying to convert over my OpenSL ES code to use SFML-audio and just ran into a hiccup.

The way I am playing sounds currently is by keeping a pool of sound players, where when a player is finished it marks itself as available so it can be "recycled." I saw in another post on these forums that we should be recycling Sound players in SFML as well because of the internal limit. However the hiccup comes when there is no callback ability on the sf::sound object.

So how do most people recycle their sound players without a callback? Do you call a function after every frame or some interval to see what sounds are finished playing? That seems pretty wasteful, but looks like the only workaround as far as I can tell aside from modifying the SFML code to add callbacks.

Pages: [1]
anything