Hi,
I am trying to make pygame play music on windows. This simple program:
import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3) print "Play" pygame.mixer.music.play()
while pygame.mixer.music.get_busy(): print "Playing", pygame.mixer.music.get_pos() time.sleep(1) print "Done"
seems to work. It runs the loop and prints values that look like ms into the file. After a reasonable time corresponding to the length of "file1.mp3" the loop is exited and the program ends.
The same thing happens for .mp3 files, .ogg files and .wav files.
Fine. The only problem is that there is no sound :-).
What am I doing wrong? pyGame example games do play sound, but I have not found an example that uses music.
My ultimate goal is to build a MP3 jukebox that runs on Windows and Linux. I have chosen pyGame as I am making a graphical Frontend using OpenGL. I have also tried to look at pymad (which I could not get to work on Windows, no C-Compiler on this machine and I could not find binaries) and audiere (no skipping, at least in the python binding. A feature I would like to have.)
Ciao, MM -- Marian Aldenhövel, Rosenhain 23, 53123 Bonn. +49 228 624013. http://www.marian-aldenhoevel.de "Wir brauchen keine Opposition, wir sind bereits Demokraten." -- http://mail.python.org/mailman/listinfo/python-list