Playing an audio file using Python

I saw most of the questions on this topic, but almost all of them are outdated. (This is not a hoax)

My requirement is a light weight library for easy playback of audio files such as mp3, etc. from Python (2.7)

These are the libraries that I have studied so far, and I list what prevents me from using each of them:

  • PyMedia : It was last updated in February 2006.
  • Mp3Play : only XP is supported and was last updated in 2008.

I also tried Pyglet , but even this does not look very good. I also heard that wx has mp3 support, and I'm trying to do it. Any comments on the same?

What reliable lightweight library do other users use these days?

PS: please post one library only per answer

+7
source share
1 answer

I'm not sure what your pyglet problem is. Playing mp3 with this couldn't be simpler:

 import pyglet sound = pyglet.media.load('mysound.mp3', streaming=False) sound.play() pyglet.app.run() 

Pyglet is well supported, cross-platform, and very small for a multimedia library.

+12
source

All Articles