What python library to use for non-blocking audio I/O on OSX?
I would like to read and write audio in Python. I tried Py开发者_如何学运维Audio 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!
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.
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
精彩评论