Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pause and resume audio recording using AVAudioRecorder

I need to pause and then resume an audio recording, I'm using AVAudioRecorder for my recording sessions... Anyone knows how to do this? Any help will be higly appreciated! Thanks a lot Peace Massy

like image 768
Blue Avatar asked Dec 26 '22 20:12

Blue


2 Answers

After initializing and creating an object of AVAudioRecorder, lets say AVAudioRecorder *recorder, simply call [recorder record] to record and [recorder pause] to pause.

If you are calling record and pause in separate method e.g. on click of different buttons then you need to make recorder a class level variable.

like image 116
Sehrish Khan Avatar answered Mar 06 '23 22:03

Sehrish Khan


To pause the recording, use the following methods on AVAudioRecorder:

- (void)pause

and to resume, use:

- (BOOL)record

It's all here in the docs...

like image 32
GarlicFries Avatar answered Mar 06 '23 20:03

GarlicFries