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

Re: [pygame] Check Sound status in Pygame



You can see if a channel is busy.

So you can see if a sound has finished playing by tracking which
channel the sound is playing on.

You can also stop (or more likely fade the volume down of) channels if
you want.  So if you know which sounds are playing on which channel
you can also stop sounds.

I would probably implement my own fading out instead of using
Channel.fadeout, because the pygame one is blocking.

You can also get the sound object from a channel, and compare that to
a sound to see if a particular sound is playing on a channel.

cu,


On Feb 18, 2008 5:04 PM, Wyatt Olson <wyatt.olson@xxxxxxxxx> wrote:
> Hello all,
>
> I am developing a drum sequencer program using Pygame, and have a
> (hopefully easy) architectural question for you.  How can you tell if a
> Sound object is currently playing? (On any channel - I don't care where
> it is playing, I just want to know if it is).  There is no
> 'is_playing()' or similar method which I could find.  I imagine that
> this is a pretty common request, so I must be just missing something.
>
> Thanks!
>
>
>
>