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

Re: [pygame] Only first call to Sound.play() is working



Pablo Moleri wrote:
    import time
    import pygame

    pygame.mixer.init()
    sound = pygame.mixer.Sound("my_sound_file.wav")
    sound.play()
    time.sleep(10)
    sound.play()

If that's you're entire program, I'd say it's finishing before
the second sound gets a chance to play. The sound.play() call
only *starts* the sound playing, it doesn't wait for it to
finish.

Try putting another time.sleep(10) after the second play.

--
Greg