简体   繁体   中英

Cross-platform Audio Playback in Python

Is there a cross-platform Python library for audio playback available? The operating systems I am targeting are (in order of importance) Windows, Linux, and Mac OSX. The file formats which need to be supported are (in order of importance) MP3, OGG, WAV, and FLAC. Does something like this exist?

I have tried a few of the Python libraries available such as Snack, PyMedia, PyGame, etc. I couldn't get PyMedia to compile, Snack wouldn't play audio, and PyGame wouldn't play audio either. I'm on Linux: Ubuntu 9.10.

gstreamer is multiplatform. It runs on Linux, PPC, ARM, Solaris on x86 and SPARC, MacOSX, Microsoft Windows, IBM OS/400 and Symbian OS.

It's probably overkill for what you want, but I've had good experience with the PyAudiere library. I've had it working on Windows and Linux without trouble, but I haven't tested it on OSX yet.

The music page at the Python wiki lists many possibilities -- indeed it's intended to be exhaustive (you can edit it to add something that it's missing;-). I don't have direct experience with the vast majority of these tools and library, but at least from the list it seems that many claim to support at least MP3 and OGG (fewer explicitly mention WAV or FLAC;-).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM