Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a time limit when recording an audio clip?

I looked for search terms along the lines of the post title, but alas..

I am building an iPhone app using AVFoundation.

Is there a correct procedure to limit the amount of audio that will be recorded? I would like a maximum of 10 seconds.

Thanks for any help/advice/tips/pointers..

like image 927
ICL1901 Avatar asked Apr 17 '11 18:04

ICL1901


1 Answers

AVAudioRecorder has the following method:

- (BOOL)recordForDuration:(NSTimeInterval)duration

I think that will do the trick!

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html#//apple_ref/doc/uid/TP40008238

like image 159
sbooth Avatar answered Nov 01 '22 06:11

sbooth