3
"""extremely simple demonstration playing a soundfile
4
and waiting for it to finish. you'll need the pygame.mixer
5
module for this to work. Note how in this simple example we
6
don't even bother loading all of the pygame package. Just
7
pick the mixer for sound and time for the delay function."""
10
import pygame.mixer, pygame.time
14
#choose a desired audio format
15
mixer.init(11025) #raises exception on fail
19
file = os.path.join('data', 'secosmic_lo.wav')
20
sound = mixer.Sound(file)
24
print 'Playing Sound...'
25
channel = sound.play()
29
while channel.get_busy(): #still playing
30
print ' ...still going...'