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

Everything else that doesn't fall into one of the other PB categories.
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

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

Post 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
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

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

Post 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.
Quin
Addict
Addict
Posts: 1124
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

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

Post 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?
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

No we use the lastest version.
Quin
Addict
Addict
Posts: 1124
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

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

Post 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.
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

Sure I will add it for next beta
Post Reply