[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Mixer channel limit



Anton Shafarenko wrote:
mixer.set_num_channels(16)
Is there any way of extending this limit, or is this an inherent
restriction in the design of pygame?
Setting the number of channels should work fine. I expect this is a bug, probably introduced when audio channels got queues. It will definitely be fixed in the next release. With any sort of luck that is 5-6 weeks away.

In the meantime, you may be able to stretch the usage of your 8 channels. SDL_mixer and pygame allow you to "reserve" the first few channels, so they will not be automatically selected from Sound.play. This could allow you to always have 1 or 2 channels reserved for high priority sounds, and the other sounds just cycle through the remaining 4.

http://www.pygame.org/docs/ref/pygame_mixer.html#set_reserved