在iOS 10或更低版本中,当我们设置了带有playAndRecord类别的AVAudioSession时,AirPods曾经被选为默认输入&配置RemoteIO时的输出。我可以通过在回调中静音样本来抑制输出但是从iOS11开始,似乎AirPods不会被选为输入,只输出。 RIO使用内置麦克风而在AirPods上听到输出这是iOS11上的新行为吗?如果是的话,我们如何获取AirPods等蓝牙输入?如果有所作为,我也会运行AVCaptureSession。
答案 0 :(得分:0)
默认情况下,您可以将AVAudioSessionCategoryOptionAllowBluetoothA2DP
和AVAudioSessionCategoryOptionAllowBluetooth
传递给setCategory
以选择AirPods麦克风:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionAllowBluetoothA2DP
error:&error]