views:

74

answers:

1

Hi guys

I'm actually making an app which has to play and record streaming audio from internet on ipad. The streaming of the audio is done, I will have to come to the recording part very soon and I don't have any idea on how to proceed.

Could you give me a hint??? Idea? It will have to play while simultaneously recording into AAC or MP3.

Thanks.

+1  A: 

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.

lucius
Hi luciusThanks, can you explain a little bit more xD I'm a new and i'm lost :s
okayasu
Do you have a specific question?
lucius
Do you have an example of code which does this i.e recording? :(
okayasu