Here is an example script that uses the
viztask module to loop through a playlist of songs. Let me know if anything is unclear.
Code:
import viz
import viztask
viz.go()
PLAYLIST = ['crash.wav','BOING!.WAV','quack.wav']
def PlayMusicTask(songs):
"""Task that loops through a playlist of songs"""
#Preload all songs
songCycle = viz.cycle([ viz.addAudio(filename) for filename in songs ])
#Loop indefinitely through song list
while True:
#Play next song
song = songCycle.next()
song.play()
#Wait for song to end
yield viztask.waitMediaEnd(song)
#Schedule music task
viztask.schedule( PlayMusicTask(PLAYLIST) )