Listen to ofEvent audioIn in custom class


How can I listen to the audioIn event in a custom class?

I tried to add the event by:

ofAddListener(ofEvent().audioIn, this, &MyClass::audioIn);

but it seem that audioIn is not a member of ofCoreEvents.

I am working with OF 0.9.4.

Thanks for help,

hi, did you ever figure this out?

The way to listen to audio events is by setting them in the soundstream settings. If you have a class like:

class MyClass{
    void audioIn(ofSoundBuffer & buffer);
    void audioOut(ofSoundBuffer & buffer);

In ofApp:

ofSoundStream soundStream;
MyClass myobj;

ofSoundStreamSettings settings;
// set any other required settings
1 Like