How to record iPhone audio output? (e.g. sounds of my application)

I want to record the sound of my iPhone application. Since someone is playing something on the iPhone instrument, and after that you can hear it.

Is it possible without micro?

+4
source share
1 answer

Do you mean the application you are building? If so, you can simply save the displayed signal (possibly encoded / compressed to save space) for later playback. (see Advanced Audio File Services , it can write the same AudioBufferList file to a file that you will display in the RemoteAudio Unit when playing sound in your Tool-application)

[Edit: deleted comments when recording audio files of third-party applications ...]

With the AVFoundation that you use, you always work at the audio file level. Your code never sees the actual audio signal. Thus, you cannot β€œcapture” the audio signal generated by your application when using it. In addition, AVAudioPlayer does not provide any means to receive the final signal. If you use multiple instances of the AVAudio player to play multiple sounds at the same time, you also cannot receive the mixed signal.

Alas, you probably have to use CoreAudio , which is a much lower level interface.

I would like to suggest an alternative approach: instead of recording the audio output, why not record the sequence of actions along with the time that leads to the reproduction of sound? Write this sequence of events to a file and read it back to reproduce "performance" - this is a bit like your own MIDI sequencer :)

+1
source

Source: https://habr.com/ru/post/1299789/


All Articles