Page 1 of 1

Increase audio source count

Posted: Fri Oct 23, 2015 3:06 am
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.

Re: Increase audio source count

Posted: Fri Oct 23, 2015 3:49 am
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.

Re: Increase audio source count

Posted: Fri Oct 23, 2015 9:15 am
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.

Re: Increase audio source count

Posted: Fri Oct 23, 2015 3:37 pm
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.

Re: Increase audio source count

Posted: Fri Oct 23, 2015 6:09 pm
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