从蓝牙输出AudioSession输入到线路输出或扬声器 [英] AudioSession input from bluetooth output to line out or speaker

查看:642
本文介绍了从蓝牙输出AudioSession输入到线路输出或扬声器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在音频会话已经成立了以下code可让蓝牙输入。

Once an audio session has been set up the following code allows bluetooth input.

UInt32 allowBluetoothInput = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &allowBluetoothInput);

这code看起来像只允许蓝牙输入然而这code也路由音频输出到蓝牙装置(在蓝牙耳机的情况下)。我想路音频输出出来的线路输出或扬声器当输入从蓝牙设备来了。我只是想从一个蓝牙设备获取音频输入,我不想通过蓝牙输出音频。

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.

这是问题的可能?

推荐答案

为iOS 5的这种行为是不可能的,引述苹果的技术支持

as of iOS 5 this behaviour is not possible, quoting apple technical support

蓝牙设备不是用千斤顶在设备,因此任何其他
  音频路由必须由使用者拾起,并且不能在code被改变。去做
  这一点,你可以使用MPVolumeView的功能,这将
  有一个额外的路由插件可见允许用户指定
  输出的路由。

Bluetooth devices are not "Jacked In" devices and therefore any other audio routing must be user picked and cannot be changed in code. To do this, you can use the functionality of the MPVolumeView which will have an extra routing widget viewable allowing the user to specify the routing of the output.

有这方面的核心音频邮件列表上一个旧的线程
  功能,但行为并没有改变:

There's a older thread on the Core Audio mailing list regarding this functionality but behavior hasn't changed:

http://lists.apple.com/archives/ CoreAudio的-API / 2009 /月/ msg00030.html

MPVolumeView参考:

MPVolumeView reference:

<一个href=\"http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPVolumeView_Class/Reference/Reference.html\" rel=\"nofollow\">http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPVolumeView_Class/Reference/Reference.html

然而,MPVolumeView不允许路由输入和输出独立。

However the MPVolumeView does not allow you to route the input and output independently.

这篇关于从蓝牙输出AudioSession输入到线路输出或扬声器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆