So, I was working on a video capture application that plays background audio (from Spotify or Apple Music), and I have a small problem when there is a slight interruption in sound when opening my application during audio playback.
Here I have the ability to allow background sound to play (found in my didFinishLaunchingWithOptions in my AppDelegate class:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionMixWithOthers error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil];
Any clues to stop this beginning of the interrupt? Thanks!!
EDIT
I should also mention after installing AVAudioSession. I install my AVCaptureSession. I initialize it, then set the properties.
self.session.usesApplicationAudioSession = YES; self.session.automaticallyConfiguresApplicationAudioSession = NO;
ios objective-c audio avcapturesession
yun.cloud
source share