Play my apps sound through loud speakers without affecting other apps playing through headphones ?

I'm working on an ios app and I would like to play a sound in the background, through the loud speaker without this affecting other apps playing through another channel eg. bluetooth speaker.

I've tried alot of combinations of AVAudioSession settings. However it seems that even when I use multiRoute category and set the required input channel, my apps audio will be interrupted if any other app plays.

Settings the duckothers option allows my audio to play but this will play through whatever output channel the other apps playing through.

Furthermore, if I force using the loud speakers, This forces all sound from other apps to be routed through the loud speaker.

Is it possible to force your apps audio through the loud speaker while other apps use headphones ?

Replies

Please respond, I've tried many different combinations of multiroute and videoRecording.

I've found that multiroute forces all sound through the loud speaker unless allowBluetooth (and A2DP) is enabled, but then my audiosession is interrupted even if .mixwithothers is used.
  • Is there a way of using AudioUnit with the output channel set as loud speaker without effecting music played through a bluetooth headset from other apps ?

  • Searching for examples of how to use multiple channels I can only find these, which are incomplete, do you know of a better example ?

https://stackoverflow.com/questions/21832733/how-to-use-avaudiosessioncategorymultiroute-on-iphone-device
https://developer.apple.com/forums/thread/15416