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

Re: [pygame] noob questions about creating and playing sounds



On Mon, Jul 20, 2009 at 6:44 AM, Jerzy Jalocha N <jjalocha@xxxxxxxxx> wrote:
def play_maxtime(sound, duration):
   sound.play(loops=-1, maxtime=duration)
   pygame.time.delay(duration)

I have a few questions about this:

 * Why is it that play_maxtime doesn't work without the time.delay?
When I remove the delay line, no sound is played, despite the use of
the maxtime argument.
Make sure you aren't calling it repeatedly.  I once had a problem like this that was solved by not calling the sound repeatedly.  What can happen is that the auto-channels will get filled with queued sounds, and won't have a chance to play before being called again.  This may or may not be your problem.