Does anyone know a lib or a method for love 2d to organize sound pool?
For example, we need to play one sound several times. And next playing should start before this sound ends.
So, after checking playing status, we can start stopped sound again or, if it still playing, create a copy of it's source and start to play the copy. The quantity of copies is limited, so if we are out of limit, the stop last sound in a pool and start it from initial position.
Sound Pool (manager)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Sound Pool (manager)
Not a pool implementation, but are you aware you can use clone() on the Source ?
that way you can play the same sound many times
https://love2d.org/wiki/Source:clone
that way you can play the same sound many times
https://love2d.org/wiki/Source:clone
Re: Sound Pool (manager)
Well, as I understand, I should then manually remove all clones?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Sound Pool (manager)
You could put all clones in a table with the original one, and you can check which of them finished in a loop, and if you found one, call play on that, otherwise clone another one; you could make a tiny lib to do this too if you wanted to; alternatively there are a few libs that support these but i dont use them myself.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Sound Pool (manager)
zorg, you've described how the SoundPool should work. I know this, but I do not want to do it myself if someone did it before.
>alternatively there are a few libs
What libs? I've found noone.
>alternatively there are a few libs
What libs? I've found noone.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Sound Pool (manager)
https://github.com/drhayes/TESound - Apparently this creates new Source objects each time you call it... not the best implementation and i never recommend it, but i will mention it at the very least.
https://github.com/Ulydev/wave - A decent lib, but very specific; it does support instances but the implementation's a bit complicated.
I'd go with https://github.com/tesselode/ripple since it has a very neatly designed API, and also supports tons of features, instancing and tagging as well. (not to mention that this one does implement pooling how i explained it previously )
However if you just want pooling, and not the other stuff, it's faster to just implement it yourself.
https://github.com/Ulydev/wave - A decent lib, but very specific; it does support instances but the implementation's a bit complicated.
I'd go with https://github.com/tesselode/ripple since it has a very neatly designed API, and also supports tons of features, instancing and tagging as well. (not to mention that this one does implement pooling how i explained it previously )
However if you just want pooling, and not the other stuff, it's faster to just implement it yourself.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests