3

A client of mine wants to continually record audio and when he clicks submit he wants to submit the last 10 seconds only. So he wants a continual recording and only keeping the last x seconds.

I would think this requires something like a circular buffer, but (as a somewhat newbie for iOS) it looks like AVAudioRecorder can only write to a file.

Are there any options for me to implement this?

Can anyone give a pointer?

User97693321
  • 3,336
  • 7
  • 45
  • 69
Peterdk
  • 15,625
  • 20
  • 101
  • 140
  • Read the answer to this question. http://stackoverflow.com/questions/4238219/trim-audio-with-ios Basically what you want to do is to export your recording as an asset and then using AVExportSession trim it to the last 10 seconds. – Eugene Dec 27 '11 at 15:12

1 Answers1

2

I would use the Audio Queue Services. This will allow you isolate certain parts of the buffer. Here is the guide to it: http://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQRecord/RecordingAudio.html#//apple_ref/doc/uid/TP40005343-CH4-SW1

Algorhythm
  • 570
  • 4
  • 17
  • This works great, I do have some trouble with saving the buffers when it is m4a, but the concept works great! – Peterdk Jan 09 '12 at 16:31