views:

454

answers:

1

I want to record the sound of my iPhone-App. So like someone is playing something on a iPhone instrument and after that you can hear it.

Is it possible without the micro?

+1  A: 

Do you mean an App you build yourself? If yes, you could just save the rendered waveform (maybe encoded/compressed to save space) for later playback. (see: Extended Audio File Services, it can write the same AudioBufferList to a file that you would render to the RemoteAudio Unit when playing audio in your Instrument-App)

[Edit: removed comments on recording third-party app audio output ...]

With the AVFoundation you are currently using, you're always working on the level of the sound files. Your code never sees the actual audio signal. Thus, you can't 'grab' the audio signal that your app generates when it is used. Also, AVAudioPlayer does not provide any means of getting to the final signal. If you're using multiple instances of AVAudio player to play multiple sounds at the same time you also wouldn't be able to get at the mixed signal.

Alas, you probably need to use CoreAudio which is a much more low level interface.

I'd like to suggest an alternative approach: Instead of recording the audio output, why not record the sequence of actions together with their time which lead to the audio being played? Write this sequence of events to a file and read it back in to reproduce the 'performance' - it's a bit like your own MIDI sequencer :)

VoidPointer
Thanks, I know, that there is know way to record an app with an other app on the iphone, because you can just run one app at once - anyway I mean your first thought. I will look in the documantions. But maybe you can explain it a little bit more. My app plays wav-sounds. You can press on record and the wavs should be recorded. After that you can hear it.
Flocked
Are you using CoreAudio for your audio output?
VoidPointer
I´m using the AVFoundation, so the AVAudioPlayer. But I can try it also with CoreAudio. Which is easier to record?
Flocked