Re: [linux-audio-dev] Python

From: Lars Luthman <lars.luthman@email-addr-hidden>
Date: Mon Feb 05 2007 - 13:26:09 EET

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

Received on Mon Feb 5 16:15:01 2007

This archive was generated by hypermail 2.1.8 : Mon Feb 05 2007 - 16:15:02 EET