AVAudioSession AVAudioSessionCategoryPlayAndRecord glitch
I would like to record videos with audio using
I want audio to be audible from the default speaker and I want it to mix with other audio. So I need the options
If I do the following while other audio is playing there is a clear audible glitch in the audio from the other app:
Is there a way to get rid of this glitch?
It seems to occur when the there’s a
The configuration change (and glitch) also occurs when the app goes to the background (with or without deactivating the audio session). When returning from the background without deactivating the audio session, the glitches start to occur when the
Note that this behavior is easily reproducible by downloading Apple’s AVCamManual example. Add the following to the
Some other weird thing, which might be related:
Set the audio category to
and then change the category:
other audio stops playing despite the options flag. No errors are thrown.
As pointed out by @Cbas in the comments, an Apple Staff has confirmed there is glitch when switching from output-only to input+output routes and that there is no workaround for that issue, a possible workaround is to totally avoid switching from output-only to input-output routes by always use the