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;-).

链接地址: http://www.djcxy.com/p/9256.html

上一篇: 在Python中重命名所有文件的名称

下一篇: 平台在Python中的音频播放