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

[pygame] playing a list of songs



I am having trouble figuring out how to play a list of .mp3 files. I have tried using the for loop to cycle through the list but it repeatedly starts playing the first song in the list but never gets to the end of the song before it starts playing it again.

Here is some sample code:

import pygame
pygame.init()
list[]
list = os.listdir("/home/playList" )
for item in list:
   pygame.mixer.music.load(item)
   pygame.mixer.music.play(1, 0.0)

Any help on this would be appreciated.

Jason