I want to record the user's voice without using the headphone. I want to record it directly by iPhone and play it directly by speaker. Is there any way to do this?
views:
253answers:
2
+2
A:
To learn how to record audio from the microphone, take a look at the Speak Here sample code Apple provides.
weichsel
2009-12-31 14:23:28
+2
A:
If you mean you want to record and play without using the microphone and speakers on the headphone cords, then you can simply remove the headphone plug from the jack and the iPhone will revert to the microphone and speakers builtin to the body of the phone itself.
The easiest way to record and playback with the API is to use AVAudioRecorder and AVAudioPlayer.
If this is not what you wanted you might want to flesh your question out a bit.
TechZen
2009-12-31 16:54:24
i what to record after removing the microphone from my app
uttam
2010-01-01 08:27:02
The iPhone has a built-in microphone. As TechZen already said: The phone will fall back to it's built-in mic/speaker as soon as you remove the headphones.
weichsel
2010-01-01 10:12:33
Just to clarify, the control of the headset microphone versus the built in microphone is done in the hardware. You cannot pick with microphone/speaker set to use by software. If the headset is plugged in the hardware uses the headset and nothing in software can change that.
TechZen
2010-01-01 16:05:49