You'll need to use the lower-level AudioQueue API, and use the AudioSession API to set up the audio session.
Then you'll need to fill out an AudioStreamBasicDescription
struct and create a new input queue with AudioQueueNewInput()
and include your callback function for handling input buffers.
And then you'll need to create 3 buffers using AudioQueueAllocateBuffer()
and AudioQueueEnqueueBuffer()
. And only then will you be ready to call AudioQueueStart()
. You should also handle audio session interruptions, and handle stopping the audio queue.
That will just get you a stream of buffers containing uncompressed 16-bit integer PCM audio data. You still need to compress the data, which is another can of worms that involves using the AudioConverter
API, which I haven't done on the iPhone OS so I don't know what will work there.