OSX 上的非阻塞音频 I/O 使用什么 Python 库?
我想用 Python 读取和写入音频。我尝试了 PyAudio 和 audiolab,但两者都只阻塞音频 I/O(即在播放或录制时你不能做任何其他事情)。
现在我需要一个在 OSX 上执行非阻塞音频 I/O 的库。 LGPL/BSD 许可证、pip 兼容性和 numpy 数组播放的奖励积分!
I would like to read and write audio in Python. I tried PyAudio and audiolab, but both only do blocking audio I/O (i.e. you can't do anything else while they play or record).
Now I would need a library that does non-blocking audio I/O on OSX. Bonus points for LGPL/BSD license, compatibility with pip and playback of numpy arrays!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几天前,我向 pyAudio 提交了一个补丁,该补丁启用了非阻塞音频 I/哦,那里。
从版本 0.2.7 开始,补丁已加入。现在 PyAudio 正式支持非阻塞 I/O。
A few days ago, I submitted a patch to pyAudio that enables non blocking audio I/O there.
As of Version 0.2.7, the patch is in. Now non-blocking I/O is officially supported by PyAudio.
你看过 Pygame 吗?它是 SDL 库的一个非常全面的包装器,它允许您在进行其他处理的同时排队和播放音乐。
http://www.pygame.org/docs/ref/mixer.html
它还具有用于在 pygame Sound 对象和 Numpy 数组之间进行转换的例程。
http://www.pygame.org/docs/ref/sndarray.html
Have you taken a look at Pygame? It's a very comprehensive wrapper around the SDL library and it will allow you to queue up and play music while doing other processing.
http://www.pygame.org/docs/ref/mixer.html
It also has routines for converting between pygame Sound objects and Numpy arrays.
http://www.pygame.org/docs/ref/sndarray.html