Closed srish closed 5 years ago
After searching for this issue a bit more, I found a related one here: https://github.com/jsierles/react-native-audio/issues/85. It seems like it might be happening because there isn't much time gap between stopping/pausing the recording and deactivating the audio session. If I add a delay between the two executions after this line in RNSoundRecorder.m
(see below), it works.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(100.0 * NSEC_PER_SEC)),
dispatch_get_main_queue(), ^{
[session setActive:NO error:&err];
});
I'm testing the code on a 6s
device. Not sure if this seems like a right approach to address the issue. Happy to send a PR if it feels right.
@kevinresol I've added the code in the issue description with a brief explanation of what I'm trying to do.
Thanks, could you make a PR?
Closed by #31
While trying to stop the recording on IOS, I run into the following error:
AVAudioSession.mm:1079:-[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
The code is below. In a nutshell, it plays a video in the background by default, and there is a button for recording/ stopping the audio.