bastibe
bastibe

Reputation: 17217

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 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!

Upvotes: 3

Views: 3111

Answers (2)

bastibe
bastibe

Reputation: 17217

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.

Upvotes: 3

stderr
stderr

Reputation: 8732

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

Upvotes: 1

Related Questions