mp3 module

Pete Shinners pete at visionart.com
Wed Dec 6 15:23:00 EST 2000


"Markus von Ehr" <vonehr at ira.uka.de> wrote
> is there a module to play mp3 files with python?

it's probably a bit overkill, but if nothing else crops up...

the pygame module can playback mp3 music quite easily.
it requires a couple dependencies, but you can grab the
full windows binary for an easy install. (RPMs also avail)

import pygame.mixer, pygame.time
pygame.mixer.init(44100)
music = pygame.mixer.music
music.load('mymusic.mp3')
music.play()
while music.get_busy(): #still playing
    pygame.time.delay(1000)


anyways. pygame might be a bit overblown for your
situation, but it can do the job. other than that you
might want to look into Snack(or is it Smack?). there is
also a new wrapper for openAL. i'm not sure if either
of these play MP3, but they are more audio specific.

pygame: http://pygame.seul.org
openal: http://213.93.58.229/alpy/






More information about the Python-list mailing list