Question about Audio for iOS (SessionCategory?)
Question about Audio for iOS (SessionCategory?)
- Subject: Question about Audio for iOS (SessionCategory?)
- From: "Eric E. Dolecki" <email@hidden>
- Date: Fri, 18 Aug 2017 17:10:02 +0000
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 (email@hidden)
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:
This email sent to email@hidden