How to go about audio

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: How to go about audio

Post by kikito »

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.
When I write def I mean function.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: How to go about audio

Post by BlackBulletIV »

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. :)
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: How to go about audio

Post by kikito »

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!
Oh, in that case - give a look to my implementation. Feel free to adapt it to your needs.
BlackBulletIV wrote:EDIT: By the way, congrats on 800 posts. :)
Thanks! Lately I'm on fire :)
When I write def I mean function.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: How to go about audio

Post by BlackBulletIV »

kikito wrote:Oh, in that case - give a look to my implementation. Feel free to adapt it to your needs.
Will do then.
kikito wrote:Thanks! Lately I'm on fire :)
Ha ha. As for me, I've just hit 100. I guess that means I've been let in on the party. :awesome:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests