Direct calls to Audio Unit instead of callbacks iOS

391 views Asked by At

Are there direct calls to the audio unit so that I don't have to depend on the system callbacks-input and render callbacks(I can mimic this with a timer). For example, like there is AudioUnitRender to pull data from the audio unit, is there another API to push data to the audio unit?

2

There are 2 answers

0
Nik Reiman On

While I'm not aware of a specific push-like call in the CoreAudio API, you can easily accomplish this by doing your DSP processing in a separate C function which takes floating point buffers passed into it. This way, the render callback can do the hard work there, and you can also call the function manually if you need to do push-based processing.

0
EhTd On

The audio units behavior is the pull model. The output request data to play and if it has it, then it plays.

The common way to start recording is to call Render within the output callback. The Render will get you the data from the recorder which can be played or just save your recorded data to somewhere else and set the player to play silence.