I have an application that plays snippets of audio - mainly targetted
towards BT headphones. It works, however it stops audio from other apps.

For instance, I am listening to some Apple Music on my phone over my
headphones. My app then plays some audio - which comes through the
headphones as expected, but when my audio is done, the Apple Music audio is
paused. I have to go back to Apple Music and play again. How can I avoid
this? This is my current setup.

let audioSession = AVAudioSession.sharedInstance()
        do {
            try audioSession.setCategory(AVAudioSessionCategoryPlayback,
with: [.allowBluetooth, .mixWithOthers])
            try audioSession.setActive(true)
        } catch {
            print("Error")
        }

My capabilities are: background modes: Audio, Airplay, and Picture in
Picture, Location Updates, Uses Bluetooth LE accessories, Background Fetch,
and Remote Notifications.

I was expecting that when my audio completes (mp4 followed by a bit of
AVSpeechSynthesizer), that the Apple Music would continue to play.

??

Thanks,
Eric
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to