Live Audio Recording

I am actually creating an application that should play and record streaming audio from the Internet to an ipad. Audio streaming is complete, I have to start recording soon, and I don’t know how to do it.

Could you give me a hint ??? Idea? It will have to be played back simultaneously with recording in AAC or MP3.

Thanks.

+4
source share
2 answers

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.

+1
source

Look at this structure. It provides recording data while recording Streaming Kit

MP3 Playback over HTTP

 STKAudioPlayer* audioPlayer = [[STKAudioPlayer alloc] init]; [audioPlayer play:@"http://www.abstractpath.com/files/audiosamples/sample.mp3"]; 

And add your details to NSMutabledata to play offline using this delegate.

Intercept PCM data just before playing it

  [audioPlayer appendFrameFilterWithName:@"MyCustomFilter" block:^(UInt32 channelsPerFrame, UInt32 bytesPerFrame, UInt32 frameCount, void* frames) { ... }]; 
0
source

All Articles