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.
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 withAudioQueueNewInput()
and include your callback function for handling input buffers.And then you'll need to create 3 buffers using
AudioQueueAllocateBuffer()
andAudioQueueEnqueueBuffer()
. And only then will you be ready to callAudioQueueStart()
. 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.Please Look at this Framework. It provide data for recording while recording Streaming Kit
Play an MP3 over HTTP
And append its data to NSMutabledata to play offline by using this delegate.
Intercept PCM data just before its played