AVAudioRecorder not recording in iOS

653 Views Asked by At

I have made an app(Dictation) having audio functionalities such as Recording, Overwriting & Playing audio files. I have used AVAudioSession for recording & playback and I have locally saved the audio files(.m4a) and send them to server. To make recording works in background, i have added UIBackgroundModes in plist file and everything worked fine. But recording after pause failed on some conditions.

Steps to reproduce :

1) Start audio recording on 00:00 minute and pause the recording on 02:00 minutes. Total file size approximately 0.45 MB and it has been stored in app documents(sandbox). 2) After pause, I have made the device into sleep mode by tapping power button and come back to app with same screen. Continued the recording from pause and recording continues but file did not get writing to local file and file size was remains at 0.45 MB.

IF we remove the UIBackgroundModes from plist, the above steps worked fine but recording audio in the background wouldn't working since the app does not have UIBackgroundModes audio.

How to continue the audio recording after pause & device sleep mode?

Much appreciate your support.

Thank you in advance.

0

There are 0 best solutions below