Android设备之间的蓝牙音频流 [英] Bluetooth audio streaming between android devices

查看:974
本文介绍了Android设备之间的蓝牙音频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个研究,对同一个主题,发现Android设备都支持A2DP的来源和音频只能从A2DP源向A2DP沉流式传输。 A2DP接收器可以是蓝牙耳机或蓝牙音箱。

I made a research on the same topic and found that android devices are a2dp sources and the audio can be streamed only from an a2dp source to an a2dp sink. A2dp sink can be a bluetooth headset or a bluetooth speaker.

不过,我的问题是那么的如何在Android应用程序名为的的蓝牙音乐播放器

But my question is then how the android app named "Bluetooth Music Player" works?

它允许从一个移动到另一个流。所以在此情况下,收听的移动设备必须作为一个接收器。这怎么可能? 他们使用A2DP一些其他的资料呢?

It allows streaming from one mobile to another. So in this case the listening mobile device must act as a sink. How this is possible? Are they using some other profile instead of a2dp?

好吧,这可能是他们使用的是不同的配置文件。因为应用程序需要被安装在客户机侧也。 但是,如何能够从数据流的声音的蓝牙麦克风Android设备

Ok, that may be a different profile what they are using. Because the application needs to be installed in the client side also. But how it becomes possible to stream voice from a bluetooth microphone to an android device?

请帮忙。

推荐答案

不知道关于提到蓝牙音乐播放器的细节,似乎用简单的蓝牙数据连接,否则你就不需要在演奏安装客户端/发送器。照片
要流从麦克风音频到另一个设备,您可以在发送设备上记录下来,并将其发送到接收设备。您将需要实现一个协议,用于这一目的。

您可以实现替代A2DP汇服务。这是什么的水槽是:一个设备与蓝牙协议栈支持A2DP水槽的实施

修改
对于您通过您的意见详细说明的情况下,发送设备应保持原样,无需安装任何应用程序。这隐含意味着你的解决方案必须利用的事实Android设备的出的现成的蓝牙功能。
你可以在这里用的是为此限于那些机器人通常支持配置文件,这是HSP,HFP和A2DP。既然你明明想串流音乐,A2DP将是你的选择。
在应该接收音频流并做播放器,你必须实现提供了A2DP片作为自我实现的BluetoothService中的 Android的文档

你将不得不花很多精力实现这一点,我不知道,如果你需要一个许可是基于此。

Without knowing details about the mentioned Bluetooth Music Player, it seems to use simple Bluetooth data connection, otherwise you would not need to install a client on playing/sending device.

To stream audio from microphone to another device, you can record it on your sending device and send it to the receiving device. You will need to implement a protocol for that purpose.
OR
You can implement an alternative A2DP sink service. This is, what the sink is: a device with a Bluetooth Protocol Stack with an implementation of A2DP Sink.


For the case you detailed by your comments, the sending device should be left as-is, without installing any app. That implicitly means that your solution must make use of out-of-the-box Bluetooth functionality of that Android device.
What you can use here is therefor limited to those profiles that Android typically support, which is HSP, HFP and A2DP. Since you obviously want to stream music, A2DP would be your choice.
On the device supposed to receive the audio stream and do the playback, you have to implement a service providing the A2DP sink as an self implemented BluetoothService opening a BluetoothServerSocket on RFCOMM as described in Android documentation.

You will have to spend much effort implementing this, and I am not sure if you will need a license for this.

这篇关于Android设备之间的蓝牙音频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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