For reasons too convoluted to go into, I have the need to ‘tap’ the final audio going to the output device (speaker, headphones, etc) from within the app I’m working on. (just need to grab my own audio)
It would be really important to not know any structures in the app, and tie into them.
It seems like AVAudioEngine
/ installTapOnBus
is the way to go, but it’s unclear what exactly would be the input-
I have implemented all of the AVAudioBufferList -> CMSampleBufferRef code through to the expected output, and all I get is silence.
It seemed like just attaching to the mainMixerNode
should have done it, but now it seems like a “device” input would be necessary.
So the questions are:
- Is
AVAudioEngine
the SDK for this task? - If not, then what?
- If yes, then what
AVAudioNode
would serve as an input? - Is there an
AVAudioUnit
that is just the ‘current device output’?
I’m not looking for a complete solution, just the last few lines that can complete this connection, or a pointer to the framework that could accomplish this.