I'd like to capture the audio (music + sound effects) coming from my iPhone game. AVCaptureSession
seems to have only the microphone as audio source. I'd like to capture the audio, put it into CMSampleBufferRef
s and append these to an AVAssetWriterInput
.
I'm currently looking into Audio Queues. Any other ideas?
There is no API to directly capture all the sound effects and music from your game.
The most common solution is for an app to generate all sound twice, once for audio output, plus a second identical copy in the from of PCM samples to feed a DSP or Audio Unit mixer. Then feed the mixer output to AVAssetWriter or other file output. This technique is much easier to implement if all the sounds produced by your app are in the form of raw PCM audio played via Audio Queue or the RemoteIO Audio Unit API, which may require significant rewrites to your music and game sound code.