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

Re: [pygame] Using multiple music loops



> but if you have short loops that fit well in the memory and need finer
> control, it seems that Sound.play which returns a Channel (as documented
> in http://www.pygame.org/docs/ref/Sound.html#play) would do - there you
> can either query the channel busyness to know if the previous looping has
> stopped, or which is probably nicer, use end events (note that they
> behave differently than mixer.music end events)
> http://www.pygame.org/docs/ref/Channel.html#set_endevent
>
> good luck in using whatever you choose, and do report back experiences..

I created a separate Channel for the background music and check its state
every time through the main loop.  This seems to work fairly well.  All
the loops are fairly short (handful of seconds) so I'm not concerned about
memory.

Thanks for the input!