[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] pygame.init before pygame.mixer.init?
I writing a program to simply play one sound (see below for the code),
and came across some interesting behavior. If I call pygame.init()
before pygame.mixer.init(), I don't hear any sound playing. However if
I call pygame.init *after* pygame.mixer.init (as below), the sound will
play.
Is this a known behavior? What's causing the problem? I understand
that I don't need pygame.init to just play a sound, but I don't think it
should matter if I call it.
Thanks!
Clare Richardson
-------------------------------------------
import pygame
pygame.mixer.init()
pygame.init()
sound = pygame.mixer.Sound("bark.wav")
sound.play()
while pygame.mixer.get_busy():
pass
pygame.mixer.quit()