[vorbis-dev] Re: [vorbis] Finally, it can be told!

Andrew Chatham andrew.chatham at duke.edu
Fri Aug 31 17:34:42 PDT 2001



Thus spake Jack Moffitt (jack at xiph.org) : 

> So, is ao-python not suitable for your purposes?  It seems like it would be a
> great replacement (assuming we put in win32 support) for all the disparate
> audio modules python currently employs.

Actually, if you look at his example code, it does use ao-python. I only had
one problem with making libao Python-friendly (a minor problem; libao has a
really, really simple API which is nicely object-oriented), which was that
there are two different constructors for audio devices (ao_open_live and
ao_open_file), and Python doesn't exactly do overloaded functions. My solution
was to just use the latter if you passed "filename" as a keyword argument to
the constructor, which I guess will work.

I also got my ogg123.py to work with the linuxaudiodevice module. They have
different ways of constructing the objects, and also ao calls the method "play"
while linuxaudiodevice calls it "write". It might be easiest to add functions
to ao-python so that it can be used as a drop-in replacement for the existing
Python audio devices (I'm not sure how consistent they are), keeping the
existing interfaces as well.

And on the speed topic, I think that if you want blazing speed for this kind of
thing in Python, you're going to have to write pretty much all of it in C and
then have "play_this_vorbis_file" and "encode_this_wave_file" functions or
something like them. For encoding, at least.

Andrew


-- 
Andrew Chatham
Duke University '02
andrew.chatham at duke.edu

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list