Is it possible to send/receive voice from PC to Android device over Bluetooth

梦想与她 提交于 2019-11-29 15:19:55

问题


I have a PC (where java program is running), Bluetooth dongle (which supports A2DP) and Android device (2.3.6, which also supports A2DP).

I want to:

  1. Send real time voice data from PC's microphone to android device via bluetooth
  2. Send real time voice data from Android device's microphone to PC via bluetooth

I found this question, where Dennis says that "Phones are typically only Source devices (Source of the stream that can stream to sink devices), Sinks are Headsets or Bluetooth speakers.". So it seems it is possible to implement case 2? Or not? And what about case 1, is it impossible to implement?


回答1:


It is true that Android phone are uniquely A2DP source devices.

Sadly, your first case is impossible to realize if you decide to rely on the A2DP profile for streaming audio, because Android does not implement the required callbacks supposed to be handling BlueZ's advertisings when a remote device wants to stream audio to your phone.

The second use case is possible, given that you have a bluetooth enabled PC and some awesome apps that will decode and route the sound from the Bluetooth stack to the speakers. I managed once to reproduce this use case using PulseAudio and pulseaudio-module-bluetooth on Ubuntu 12.10.

Here is a working example showing how to manage the routing of the sound once a connected BT device begins to stream. Here is another one. They both take place on Linux and I never did this on Windows though.

For the sake of completeness, here is another SO answer written by me, giving details about how to implement A2DP sink capabilities on Android.

EDIT :

Nothing forbids you to implement your own protocol for audio streaming via Bluetooth on an Android device, this will work, but as it will not be a standard, it will never comply with the system built-in Bluetooth profiles (A2DP, HFP ...).



来源:https://stackoverflow.com/questions/15818704/is-it-possible-to-send-receive-voice-from-pc-to-android-device-over-bluetooth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!