从蓝牙输出到线路输出或扬声器的 AudioSession 输入
设置音频会话后,以下代码将允许蓝牙输入。
UInt32 allowBluetoothInput = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &allowBluetoothInput);
该代码看起来只允许蓝牙输入,但是该代码还将音频输出路由到蓝牙设备(在蓝牙耳机的情况下)。当输入来自蓝牙设备时,我想将音频输出从线路输出或扬声器路由出去。我只想从蓝牙设备获取音频输入,我不想通过蓝牙输出音频。
这种行为可能吗?
Once an audio session has been set up the following code allows bluetooth input.
UInt32 allowBluetoothInput = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &allowBluetoothInput);
This code looks like it only allows bluetooth input however this code also routes the audio output to the bluetooth device (in the case of a bluetooth headset). I would like to route the audio output out of the line out or speaker when the input is coming from a bluetooth device. I just want to get audio input from a bluetooth device, I do not want to output audio via bluetooth.
Is this behaviour possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 iOS 5 开始,这种行为是不可能的,引用苹果技术支持
但是 MPVolumeView 不允许您独立路由输入和输出。
as of iOS 5 this behaviour is not possible, quoting apple technical support
However the MPVolumeView does not allow you to route the input and output independently.