Page 1 of 1

New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Sun Jan 14, 2024 12:06 pm
by Lebostein
It seems after 32 sounds at the same time PlaySound() does not play new sounds:

https://lebostein.de/temp/mbox.ogg

Code: Select all

InitSound()
UseOGGSoundDecoder()
LoadSound(0, "mbox.ogg")
For i = 1 To 60
  channel = PlaySound(0, #PB_Sound_MultiChannel): Debug channel
  If channel: SetSoundFrequency(0, 6000 + i * 300, channel): EndIf
  Delay(50)
Next i
Delay(2000)
Output Mac OS (after 32 sounds the end has been reached)
2 (starts with channel 2)
3
4
...
...
33
34 (last PlaySound with a return != 0, but it seems it is impossible to set the frequency of this last sound)
0
0
0
0
0
0
...
Output Windows (all 60 sounds are played)
1906915505280
1906915505328
1906915505376
...
1906915510448
1906915510784
1906915510688
1906915510832

Re: New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Sun Jan 14, 2024 12:31 pm
by Lebostein
Ok, an older version of MiniAudio is probably the reason for this...
I have scroll down the changelog of MiniAudio and it seems the number of channels have changed with v0.11.0 (from 2021-12-18) from 32 to 254
Increase MA_MAX_CHANNELS from 32 to 254.
https://github.com/mackron/miniaudio/bl ... CHANGES.md

Perhaps this limitation should be mentioned in the PB documentation.

Re: New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Sun Jan 14, 2024 10:54 pm
by Quin
I'm more curious why PB is using Miniaudio from December of 2121 :shock:
@Fred, is it perhaps for older platforms or the like?

Re: New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Sun Jan 14, 2024 11:58 pm
by Fred
No we use the lastest version.

Re: New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Mon Jan 15, 2024 3:24 am
by Quin
Fred wrote: Sun Jan 14, 2024 11:58 pm No we use the lastest version.
Ah, I see. Is the channel limit hardcoded on the PB side? If so, a parameter to InitSound() would be good in this case I think.

Re: New PB sound lib (MiniAudio) limited to 32 simultaneous channels?

Posted: Mon Jan 15, 2024 8:10 am
by Fred
Sure I will add it for next beta