Atul Goyal
Atul Goyal

Reputation: 3521

Playing audio file with Python

I've seen most of the questions on this topic but almost all of them are outdated. (This is not a dupe)

My requirement is a preferably light weight library for simply playing audio files such as mp3,etc from Python (2.7)

These are the libraries that I've so far looked into and I'm listing what are the things that are stopping me from using each of them:

I've also tried Pyglet but even this doesn't look good. Also heard that wx has support for mp3 and I'm trying it. Any comments about the same?

Which reliable lightweight library do others use these days?

PS: please post one library only per answer

Upvotes: 9

Views: 11708

Answers (2)

droptop
droptop

Reputation: 1671

I know this is late but anyway...

Try just_playback. It's a wrapper around miniaudio that can read multiple file formats including mp3 and provides playback control functionality like pausing, resuming, seeking and setting the playback volume.

Upvotes: 0

Rafe Kettler
Rafe Kettler

Reputation: 76945

I'm not sure what your issue is with pyglet. Playing an mp3 using that couldn't be simpler:

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

pyglet is well-maintained, cross-platform, and very small for a multimedia library.

Upvotes: 13

Related Questions