You need to use the AudioQueue low-level API and use the AudioSession API to configure your audio session.
Then you need to populate the AudioStreamBasicDescription structure and create a new input queue using AudioQueueNewInput() and enable the callback function to process the input buffers.
And then you will 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 the audio queue stop.
This just gives you a stream of buffers containing uncompressed 16-bit integer PCM audio data. You still need to compress the data, and this is another feature of the worms, which includes using the AudioConverter API, which I have not done on the iPhone OS, so I donβt know what will work there.
source share