Record audio iOS

前端 未结 4 515
庸人自扰
庸人自扰 2020-12-15 09:38

How does one record audio using iOS? Not the input recording from the microphone, but I want to be able to capture/record the current playing audio within my app?

So

4条回答
  •  余生分开走
    2020-12-15 10:16

    Well if you're looking to just record the audio that YOUR app produces, then yes this is very much possible.

    What isn't possible, is recording all audio that is output through the speaker. (EDIT: I just want to clarify that there is no way to record audio output produced by other applications. You can only record the audio samples that YOU produce).

    If you want to record your app's audio output, you must use the remote io audio unit (http://atastypixel.com/blog/using-remoteio-audio-unit/).

    All you would really need to do is copy the playback buffer after you fill it.

    ex)

     memcpy(void *dest, ioData->mBuffers[0].mData, int amount_of_bytes);
    

提交回复
热议问题