Increase audio source count

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.
Post Reply
McDunkinY
Prole
Posts: 3
Joined: Thu Jun 19, 2014 4:34 am

Increase audio source count

Post by McDunkinY »

I can't find any results online / I don't even know if possible, but, is there a way to increase the audio source count? At the moment the limit is 64, if you try to create a sound after the limit has been reached, it won't play until a slot clears up.
User avatar
slime
Solid Snayke
Posts: 3159
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Increase audio source count

Post by slime »

That specific limit is only for the number of simultaneous playing sources (you can have as many non-playing sources as you want, as long as you don't run out of memory.)

The maximum number of simultaneously playing Sources can't really be increased, since it's largely a platform/driver/OpenAL backend limitation.

You could stop any playing Sources that are quiet / short / far away, if the limit is closed to being reached. I believe most (AAA and other non-LÖVE) games do a similar thing.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Increase audio source count

Post by zorg »

Alternative solution would be to mix them in real-time, which is probably overkill, but doable with this neat thing. Though you'd be using sounddata objects instead of sources then, which will take up quite a lot of memory if the stuff you want to mix are long... or you can even mix these two solutions as well.
Me and my stuff :3True 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.
McDunkinY
Prole
Posts: 3
Joined: Thu Jun 19, 2014 4:34 am

Re: Increase audio source count

Post by McDunkinY »

Thanks for your responses.

I have built a MIDI player and was trying to play Circus Galop, but it would quickly take up all 64 slots since the song is something out of the ordinary... Worked perfect for basically anything else that didn't play all piano notes at once.

I worked around it by stopping sources if the 64 limit has been reached, otherwise it just clones the note source and plays it.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Increase audio source count

Post by zorg »

Food for thought, in the olden days when trackers were just being made, on amigas mostly, they had a 4-channel hard limit because that's how many voices the current hardware (the digital-analog-converter) was capable of handling (even so, the paula was still an awesome chip)
...without software mixing, so with no CPU overhead.

After DOS was available, so were faster CPUs, and soundcards, for that matter; people started to write programs that would mix voices programmatically, and so the maximum voice limit was dependant on the speed of the processor, above the hardware limit, that is.

(OpenMPT, a tracker i still use, still has its channel limits appended by the speed (in MHz) of the CPU that can probably handle them, though ending at 256 channels with 400+ MHz CPU)

Oh, i hope you don't want to open a "black midi" file with your app :3
Me and my stuff :3True 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests