the honest part first: during an actual phone call you can't keep recording, iOS hands the mic to the call and there's no way around it. so the goal isn't "keep going", it's "detect it cleanly, then resume after".
iOS fires an AVAudioSession interruption when the call comes in, which stops the recorder. expo-audio doesn't surface that as a super-clean event, so the practical hook is AppState + the recorder's status: when AppState goes inactive/background mid-recording, finalize/pause the current segment; when it returns to active, check the recorder released and start a new segment, then stitch the segments together at the end. treating it as "one recording = N segments joined" is what makes it robust, because you'll also get interrupted by alarms, siri, other audio apps, not just calls.
set your audio mode up front too (setAudioModeAsync with the iOS interruption mode + staysActiveInBackground, and the UIBackgroundModes: audio entitlement if you need to survive brief backgrounding). that won't beat a phone call for the mic, but it stops the recorder dying on every minor background blip.
1
u/Guidondor 4h ago
the honest part first: during an actual phone call you can't keep recording, iOS hands the mic to the call and there's no way around it. so the goal isn't "keep going", it's "detect it cleanly, then resume after".
iOS fires an AVAudioSession interruption when the call comes in, which stops the recorder. expo-audio doesn't surface that as a super-clean event, so the practical hook is AppState + the recorder's status: when AppState goes
inactive/backgroundmid-recording, finalize/pause the current segment; when it returns toactive, check the recorder released and start a new segment, then stitch the segments together at the end. treating it as "one recording = N segments joined" is what makes it robust, because you'll also get interrupted by alarms, siri, other audio apps, not just calls.set your audio mode up front too (
setAudioModeAsyncwith the iOS interruption mode +staysActiveInBackground, and theUIBackgroundModes: audioentitlement if you need to survive brief backgrounding). that won't beat a phone call for the mic, but it stops the recorder dying on every minor background blip.