1

Is it possible to play audio through speakers and headphones at the same time as of iOS 11? As of right now I am trying to find an app on the store that can do this, so far I have had no luck. I have found a few other threads, but they don't seem to be working for me or they say you can't. Here are a few of the links,

https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html

https://stackoverflow.com/a/35009801

https://apple.stackexchange.com/questions/48534/is-it-possible-to-play-sound-through-both-the-headphone-jack-and-my-internal-spe

iOS: Is it possible to send audio out both headphones and speakers at the same time?

Has anyone tried to play sounds through the speakers and headphones at the same time? Android + iOS

What is really strange is that I cannot find any official documentation saying whether this is possible only that 'The built-in speaker may be used only if no other eligible output ports (USB, HDMI, LineOut) are connected.'

If you need code let me know, but really I am just wondering if it is possible and what is the best route for doing this? The key thing is that I want to do it simultaneously. Thanks.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • https://stackoverflow.com/questions/21832733/how-to-use-avaudiosessioncategorymultiroute-on-iphone-device/35009801#35009801 This has an answer. you tried? – janusfidel Apr 13 '18 at 16:21
  • Is that at the same time? No I have not yet, it doesn't say at the same time, he said just routing to both. Is that what he means? – iphoneworker918 Apr 13 '18 at 16:26
  • It suggested the use of `avaudiosessioncategorymultiroute` which is I believe for that purpose. – janusfidel Apr 13 '18 at 17:22
  • I have tried the code in post and as pointed out in the original post, if you are using `avaudiosessioncategorymultiroute` the documentations states 'The built-in speaker may be used only if no other eligible output ports (USB, HDMI, LineOut) are connected.'. Also the [stackoverflow.com/questions/21832733/](https://stackoverflow.com/questions/21832733/how-to-use-avaudiosessioncategorymultiroute-on-iphone-device/35009801#35009801) does not work. He uses `_outputPortChannels` and didn't explain what it is. – iphoneworker918 Apr 13 '18 at 18:59

1 Answers1

1

So after some further review, I would like to save everyone the headaches that I had to go through. Is it possible? Probably, however Apple as of right now does not supply any way to do this. There seems to be no official documentation as to if it can be done (please update this answer if you find some).

The best evidence I have to support my answer would that Apple states 'Important: The built-in speaker may be used only if no other eligible output ports (USB, HDMI, LineOut) are connected.' Also in the solutions posted here, neither method works. I have tested both with iPhone 7 on iOS 11.

NOTE* in the second method I think that the writer was confusing 'channels' with 'routes'. He is changing and selecting the channels (this would be like left, right, or middle speaker for devices that support it), whereas I was looking to change the route (play in the speaker, play in the headphones, HDMI, USB, and ect...). So, in my opinion, NO YOU CANNOT play on the headphones and the speaker at simultaneously (different sounds or the same), unless you are Apple or I am wrong.