views:

90

answers:

1

I have an AVAudioRecorder that captures the sound. What I want is to be able to Play(AVAudioPlayer) the recorded(AVAudioRecorder) sound as it is being recorded.

I have set up the AVAudioSession property to playandRecord... but I dont know how do I program the following sort of scenario? Like you have your head phones on and you are walking,some one beeps at you, but u can't listen because of your headphones on, but what if your iPhone captures that beep and plays right away.

If i am recording and playing on the same file at the same time. Will that be a problem? Any help regarding this would be anticipated.

A: 

No there is no problem in that. There is an adequate sample code by apple aurioTouch. It uses the Audio Unit framework and is a very low-level framework which allows you to access several features of the audio hardware. Also check out this tutorial from iphoneAM which will make your work easier. http://www.iphoneam.com/blog/index.php?title=using-the-iphone-to-record-audio-a-guide&more=1&c=1&tb=1&pb=1

Viraj