[linux-audio-dev] Python

Lars Luthman lars.luthman at gmail.com
Mon Feb 5 11:26:09 UTC 2007


On Sat, 2007-02-03 at 16:28 -0200, Silver Rock wrote:
> I've been studiyng python and some things are not that clear:
> 
> 1- Is python too slow to efectivelly communicate with Jack? PyJack did
> not seem to work right, so i tried PySndObj's JackIO object. It did
> not behave as good as with connection with ALSA.

Depends on what you mean. Writing the actual process() callback in
Python is probably not a good idea, not as much because of the speed
(although you probably wouldn't want to use Python if you want to
squeeze as much processing as possible out of the computer) but because
of the unpredictability caused by the builtin garbage collection and
memory management. Then again, I'm no Python expert. Maybe it's possible
to tweak the interpreter so it can run in hard realtime.


> 4- Are any differences between 'r' and 'rb'; 'w' and 'wb' in: 
> 
> wave.open('file', 'r')        wave.open('file', 'rb')
> wave.open('file', 'w')       wave.open('file', 'wb')

'r' opens a file in text mode, 'rb' opens it in binary mode. On
UNIX-like systems there is no difference. I don't know if Python is
clever enough to always open a sound file in binary mode on systems
where there is a difference, but it can't hurt to add the 'b' anyway.


--ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20070205/ab7b8ce5/attachment.pgp>


More information about the Linux-audio-dev mailing list