Audio in openframeworks

Hi all,
i am going through the audio examples in openframeworks.
The aim is to figure out what possibilities exist there to work with sound input.

of course I started from the audio in example.
I see there is a function called “audioIn” that receives and processes the audio. However, it is called nowhere inside the example.
How does that work? how do I get controll of the audio in function?

Additionally I remember reading that libjack is necessary for the installation of OF. Is that still the case? can I actually use JACK with OF? what sort of posibilities open up?

Thank you for youe help

audioIn() is a callback, not a function you call yourself. What this means is that openFrameworks will call that function for you, whenever there’s new audio to process (the same way draw() gets called whenever it’s time to draw a new frame).

When audioIn() is called, the float * input parameter will be a pointer to buffer of new samples that just came in from (for example) a microphone connected to your computer. In the audioInputExample, there’s a demonstration that shows you how to iterate over the samples like an array.

audioOut() is similar, in that it will get called automatically whenever your app has to produce sound. You write the sound you generate to the float * output parameter (the audioOutputExample demonstrates writing a sine wave).