Re: [linux-audio-user] Python and Jack

From: Cesare Marilungo <cesare@email-addr-hidden>
Date: Thu Dec 07 2006 - 20:37:03 EET

Renato Fabbri wrote:
> Hi all,
>
> I am trying to output some audio through jack using the sndobj library. I get only a short beep..
>
> Usind the sndobj library on python, pysndobj, here is a simple case of what, in my head, should output a left channel sinusoid for 3s:
>
> ___
> from sndobj import *
> import time
>
> tab = HarmTable()
> osc = Oscili(tab, 440,16000)
>
> jack = SndJackIO('theremin')
>
> jack.SetOutput(1, osc)
>
> osc.DoProcess()
>
> jack.Write()
>
> time.sleep(3)
>
> del jack
> del osc
>
> _________
>
> help?
> renf
>
Ciao Renato,

your code doesn't work here, either.

I think you should use a thread, like it's explained in the SndOsc manual.

Here's a modified version of your code. I've tested it and it works:

from sndobj import *
import time

tab = HarmTable()
osc = Oscili(tab, 440,16000)

jack = SndJackIO('theremin')
jack.SetOutput(1, osc)

thread = SndThread()
thread.AddObj(osc)
thread.AddObj(jack, SNDIO_OUT)

thread.ProcOn()
time.sleep(3)
thread.ProcOff()

Ciao,

c.

-- 
http://www.cesaremarilungo.com
Received on Thu Dec 7 20:15:02 2006

This archive was generated by hypermail 2.1.8 : Thu Dec 07 2006 - 20:15:02 EET