使用Python播放音频文件
我看过关于这个主题的大多数问题,但几乎所有问题都已经过时了。 (这不是骗局)
我的要求是一个最好的轻量级库,用于简单地从 Python (2.7) 播放音频文件,例如 mp3 等
这些是我迄今为止研究过的库,我列出了阻止我使用它们的原因:
我也尝试过 Pyglet 但即使这样看起来也不太好。 还听说wx支持mp3,我正在尝试。有同样的评论吗?
现在其他人使用哪个可靠的轻量级库?
PS:每个答案请仅发布一个库
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定您的问题与
pyglet
有关。使用它来播放 mp3 再简单不过了:pyglet 维护良好、跨平台,而且对于多媒体库来说非常小。
I'm not sure what your issue is with
pyglet
. Playing an mp3 using that couldn't be simpler:pyglet is well-maintained, cross-platform, and very small for a multimedia library.
我知道已经晚了,但无论如何......
尝试 just_playback。它是 miniaudio 的包装器,可以读取包括 mp3 在内的多种文件格式,并提供播放控制功能,如暂停、恢复、查找和设置播放音量。
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.