Android设备作为一个接收器支持A2DP [英] Android device as a receiver for A2DP profile

查看:5226
本文介绍了Android设备作为一个接收器支持A2DP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想现在做的是使用Android设备作为A2DP接收器和配对成立时,Android的播放声音是从发射机接收。我担心如果我使用STP的配置文件,它可能会导致流的延迟。所以,我想使用A2DP,但是这是可能使用Android设备的支持A2DP的接收器?怎么办呢?

Basically, what I am trying to do right now is use an android device as an A2DP receiver and when pairing established, android plays sound that is received from a transmitter. I am worrying that if I use STP profile, it may cause delay of streaming. So, I want to use A2DP but is this possible to use an android device as a receiver of A2DP? and how to do it?

推荐答案

由于Android L时BlueDriod堆栈不支持A2DP片,但它默认是禁用的。

Since Android L the BlueDriod stack does support A2DP sink, but it is disabled by default.

要启用它做到以下几点:

To enable it do the following:

/* Enable bluetooth av sink. */
#define BTA_AV_SINK_INCLUDED TRUE

/外部/蓝牙/ bluedroid /包括/ bt_target.h 。 这使得沉支持的蓝牙堆栈。

in /external/bluetooth/bluedroid/include/bt_target.h. This enables sink support in the bluetooth stack.

此外,你需要做的这种变化:

Also you have to do this change:

<!-- Enable sink support. -->
<bool name="profile_supported_a2dp_sink">true</bool>

/封装/应用程序/蓝牙/ RES /价值/ config.xml中。这使得特定的用户界面。

in /packages/apps/Bluetooth/res/values/config.xml. This enables the particular UI.

现在,你可以对你的设备,并开始流。不幸的是,你会听到任何声音,虽然你会收到的报文。其理由是,有支持A2DP水槽没有音频路由。在这个补丁的提交信息 https://android-review.googlesource.com/# / C / 98161 / 你可以找到关于如何解决此问题的示例实现。

Now you can pair your devices and start streaming. Unfortunately you will hear no sound although you'll receive the packets. The reason is that there is no audio route for A2DP sink. In the commit message of this patch https://android-review.googlesource.com/#/c/98161/ you can find a sample implementation on how to fix this.

下面是这些更改的列表:

Here is a list of these changes:

  • https://android-review.googlesource.com/#/c/97832/
  • https://android-review.googlesource.com/#/c/97853/
  • https://android-review.googlesource.com/#/c/97833/
  • https://android-review.googlesource.com/#/c/98130/
  • https://android-review.googlesource.com/#/c/98131/

这篇关于Android设备作为一个接收器支持A2DP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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