Get Output Buffer from API


Currently I’m developing an app in JUCE that uses the FMOD API for behaviour handling of events and other things, and I’d like to tap into the output buffer in order to pass it into the JUCE buffer, instead of having FMOD handling the audio output.

I’ve tried to tap into the channel in order to do the above but ended up with crackle and it just overall didn’t feel like the most efficient way to solve this issue.

So my question is, what is the best way to access the Master Bus buffer from FMOD?

Thanks in advance!

There are a few ways to get access to the audio buffer. Since you are using Events / Studio API the best way to access the raw audio data would be to attach a custom DSP to the Master Channel and read from the inbuffer in the DSP’s read callback. I would recommend looking at the dsp_custom Core API example for a reference on how to create a DSP and read incoming audio data at runtime.
If you are still getting crackling after doing that you may need to modfy your design to add an intermediate buffer between FMOD and JUCE, and if you already have one then you may need to increase the distance between your read and write pointers to ensure there is always enough audio data for JUCE to read.