[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] queued sounds and music



I've just checked in some code to cvs that allows pygame to queue music and
sound objects. Queued music objects are preloaded and played as soon as the
current music finishes naturally. channels can also queue a sound object to
be played when the current sound finishes. This should allow for as
seamless as possible playing of sound effects. The sound is started from
inside the SDL_mixer callbacks.

You can now also get "SOUNDDONE" style events from channel objects. these
are a little more "liberal" than the music style events, since they will be
fired when the music is stopped/replaced/queued by hand.

The new stuff for sound objects (queuing and events) only works with
SDL_mixer-1.2.3 or above. although a few fixes make 1.2.4 strongly recommended.


I know a couple people were looking for this type of functionality.
Hopefully it's easy for you to grab pygame from cvs and get testing. I've
made some contrived little scripts that test this all out, and they seem to
be working well. But there's a lot of tricky reference counting going on
inside, and I could have easily gotten something wrong.

Here's some links to the docs if you want a quick peek.
http://pygame.org/docs/ref/Channel.html#queue
http://pygame.org/docs/ref/Channel.html#set_endevent
http://pygame.org/docs/ref/pygame_mixer_music.html#queue

oh, and i've tried to make the docs not suck too embarrasingly


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org