From: salsaman <sal...@xs...> - 2006-12-05 19:42:44
|
>> >> >If you need some help with jack, look at jack.c in LiVES, in particular >jack_open_device(). I will shortly be adding code to grab audio from jack. > > >Hope this helps, >Gabriel. > > > > Here you go, look at http://lives.cvs.sourceforge.net/lives/lives/src/jack.c First I call jack_audio_read_init() [note that not all of the fields are actually used, for example, I don't use "mute" or "out_sample_rate" for my jack reader]. This is done when the app. starts up. Then to initiate reading, I call: jack_open_device_read() followed by jack_read_driver_activate(). This connects my jack inputs to the pcm_capture ports. Jack will call the audio_read() callback each time a new audio buffer is ready. So you would presumably cache this somewhere in libvisual. Finally, I call jack_close_device() to stop capture. You can also look at audio.c, functions: rec_audio_to_clip() and rec_audio_stop() to see how the jack functions are called. Also in audio.c, you have the function: sample_move_float_int() which will convert jack's float type samples to integer values if you need to. HTH. Gabriel. |