tags:

views:

141

answers:

3

I want to both play sound and record sound at the same time on the iPhone.

All the apps which record sound first disable any music playing. However as music would disrupt their purpose I don't know if they're doing this deliberately or whether the iPhone does it automatically when you record from the microphone.

Does anyone have experience with this?

+1  A: 

Refer to this page. Good luck!

Simon
A: 

I've heard something about this on one episode of the mobile orchard podcast - the one with Michael Tyson, the creator of Loopy. During the discussion, Michael explained that he had to include some code to filter out the sounds that were coming in through the microphone in realtime as other sounds were being played on the speaker.

Based on that discussion, it seems entirely possible to both play and record at the same time, but I'm sure you'll have to do your own filtering to avoid recording the sounds your playing.

Ken Pespisa
A: 

You can use either a core audio unit or an audio queue, and you need to make sure that your audio session category is set to kAudioSessionCategory_PlayAndRecord.

Beware that sound output when you use this session is much quieter than the normal solo session (observed on 3.0).

Rhythmic Fistman