Which library for audio playback ?

Jérôme jerome at jolimont.fr
Thu Dec 29 08:55:33 EST 2011


I'm writing a small application that plays sound through the speakers. The
sounds are juste sine waves of arbitrary frequency I create in the code, not
sample .wav files.

I didn't expect the choice for an audio library to be that complicated. There
are several libraries, and none of them seems to be *the* reference.

Searching the web, I found these resources :

http://wiki.python.org/moin/Audio
http://wiki.python.org/moin/PythonInMusic

* I privileged ALSA to OSS as I read elsewhere that OSS is deprecated, or on
  its way to be. (And JACK is not widely installed, apart from specific
  applications (audio work).)

* Then, I picked the alsaaudio library (http://pyalsaaudio.sourceforge.net/).
  I don't remember exactly why. I think the project had the most recent
  updates. I don't think any project claims to be (let alone aims at being)
  complete.

I'm wondering if I made a sensible choice.

There are other libraries, including the following two that are platform
independent :

* PyAudiere (http://pyaudiere.org/), OSS , not packaged for debian
* PyAudio (http://people.csail.mit.edu/hubert/pyaudio/)

What solution would you recommend ?

Are there other criterions I should take into account ?

Thanks.

-- 
Jérôme



More information about the Python-list mailing list