I favor having a pool of resources already created, always in memory. You set the size of that pool when you create the source (doing something like newsource(path, mode, poolSize)). Pool size limits the max number of simultaneous sources. Can change from source to source, and defaults to 1 (default LÖVE behavior). My custom play function parses the pool until it locates a non-playing sound, and plays it, if it exists.
This performs very well - but all the source "copies" are loaded in memory, all the time. But I can live with that; if images are loaded in memory, sources should, too.
How to go about audio
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: How to go about audio
When I write def I mean function.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: How to go about audio
Hmmmm, that sounds like a good solution; I think I might use that. That makes sure you don't blow out the sound channels. Thanks for that!
EDIT: By the way, congrats on 800 posts.
EDIT: By the way, congrats on 800 posts.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: How to go about audio
Oh, in that case - give a look to my implementation. Feel free to adapt it to your needs.BlackBulletIV wrote:Hmmmm, that sounds like a good solution; I think I might use that. That makes sure you don't blow out the sound channels. Thanks for that!
Thanks! Lately I'm on fireBlackBulletIV wrote:EDIT: By the way, congrats on 800 posts.
When I write def I mean function.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: How to go about audio
Will do then.kikito wrote:Oh, in that case - give a look to my implementation. Feel free to adapt it to your needs.
Ha ha. As for me, I've just hit 100. I guess that means I've been let in on the party.kikito wrote:Thanks! Lately I'm on fire
Who is online
Users browsing this forum: Bing [Bot] and 3 guests