pyao 0.0.2 review

Download
by rbytes.net on

pyao is a wrapper for the 'ao' library. pyao is a set of Python bindings for Xiph.org's libao, a cross-platform audio output libra

License: GPL (GNU General Public License)
File size: 15K
Developer: Andrew Chatham
0 stars award from rbytes.net

pyao is a wrapper for the 'ao' library.

pyao is a set of Python bindings for Xiph.org's libao, a cross-platform audio output library.

Installation:

python config_unix.py
python setup.py build
[as root] python setup.py install

The config script is new and still pretty weak. If you have any problems let me know. Access the module by using "import ao" in your Python code.

Here's an interactive session of just playing with the module, until I create better documentation (there should be docstrings for everything). Watch as I read some random data and "play" it to a wave file.

>>> import ao

>>> myoptions = {'file': 'myoutput.wav'}

>>> dev = ao.AudioDevice('wav', options = myoptions)

>>> f = open('/dev/urandom', 'r') #that's some good stuff

>>> print dev
< AudioDevice object at 0x812ac28 >

>>> print dev.get_driver_info()
{'author': 'Aaron Holtzman',
'short_name': 'wav',
'name': 'WAV file output',
'comment': 'Sends output to a .wav file'}

>>> print ao.get_driver_info('oss')
{'author': 'Aaron Holtzman',
'short_name': 'oss',
'name': 'OSS audio driver output ',
'comment': 'Outputs audio to the Open Sound System driver.'}

>>> data = f.read(1024*8)

>>> dev.play(data)

>>> < control-d >

And now I have a file myoutput.wav with random noise in it.

pyao 0.0.2 search tags