Keep bluetooth sound when initializing AVAudioSession

人盡茶涼 提交于 2019-11-28 01:05:53

With iOS 10, Apple added the option AVAudioSessionCategoryOptionAllowBluetoothA2DP. They also changed the meaning of AudioSessionCategoryOptionAllowBluetooth to only allow output using the HFP Bluetooth profile, which is where you get the low quality audio output.

If you use this new option in place of the AudioSessionCategoryOptionAllowBluetooth option in your code snippet, it will allow high quality output but disallow low quality audio output.

Here's the online documentation for the options, but unfortunately there's no description for the new iOS 10 options online. You can see more detail in the in-code documentation for AVAudioSession.h. https://developer.apple.com/reference/avfoundation/avaudiosessioncategoryoptions?language=objc

Unfortunately I got this answer directly from Apple Technical Support

There is no supported way to achieve the desired functionality given the currently shipping system configurations. If you would like for Apple to consider adding support for such features in the future, please submit an enhancement request via the Bug Reporter tool at http://bugreport.apple.com.

So that's it...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!