如何在 iOS 中强制将音频输出路由到蓝牙 A2DP?
How to forcibly route audio output to Bluetooth A2DP in iOS?
应用程序需要通过 HFP 录制声音,但通过 A2DP 播放声音。
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with:[AVAudioSessionCategoryOptions.allowBluetooth, AVAudioSessionCategoryOptions.allowBluetoothA2DP, AVAudioSessionCategoryOptions.mixWithOthers])
据我了解,这将允许我使用同时支持 HFP 和 A2DP 的蓝牙设备录制和播放声音。但是,当我查看文档时,它说
when a single device supports both the Hands-Free Profile (HFP) and
the Advanced Audio Distribution Profile (A2DP), the Hands-Free ports
will be given a higher priority for routing
所以,录制和播放都是HFP,我找不到强制通过A2DP播放的方法。
好的,目前没有办法做到这一点。我已经与Apple验证了这一点。
应用程序需要通过 HFP 录制声音,但通过 A2DP 播放声音。
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with:[AVAudioSessionCategoryOptions.allowBluetooth, AVAudioSessionCategoryOptions.allowBluetoothA2DP, AVAudioSessionCategoryOptions.mixWithOthers])
据我了解,这将允许我使用同时支持 HFP 和 A2DP 的蓝牙设备录制和播放声音。但是,当我查看文档时,它说
when a single device supports both the Hands-Free Profile (HFP) and the Advanced Audio Distribution Profile (A2DP), the Hands-Free ports will be given a higher priority for routing
所以,录制和播放都是HFP,我找不到强制通过A2DP播放的方法。
好的,目前没有办法做到这一点。我已经与Apple验证了这一点。