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

Re: [pygame] Question about Pygame.event.wait and pygame.mixer.get_busy



On Mon, 06 Jun 2011 10:30 +0100, sam.hacking@xxxxxxxx wrote:An
alternative would be to get
> the sound to emit an event when it finishes playing, which would move
> your loop on, although I'm not sure if this is possible.

It is possible, just found it here:
http://www.pygame.org/docs/ref/mixer.html#Channel.set_endevent
If you use that function (passing in an event type), then it should emit
an event when it finishes playing, which will tell your code to move on
from event.wait(). So, you only need to add one line of code before that
while loop.