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

1

4

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?

Earthward answered 4/4, 2013 at 18:17 Comment(0)
P
2

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 ...).

Pulsatory answered 4/4, 2013 at 21:23 Comment(10)
Thanks a lot! As I understand, I can't implement case 1 by ANY built-in Bluetooth profile? And how can I implement my own protocol for audio streaming? Can you give any advice?Earthward
Using Bluetooth for audio streaming on Android is possible but is kind of laggy due to some implementation bugs corrected in Android 4.2.2. Also it may be painful. Why wouldn't you go using Wifi and regular sockets ?Pulsatory
I have a little more than a month to prepare the next project for university. The phone connects to the computer(I make connection over bluetooth). By app on PC's side user can send/receive sms messages, make phone calls and answer to them. For a week I implemented part for making / sending sms messages over RFCOMM protocol. I don't know is it doable to realize the project under wifi for a month. I also don't know is my phone(galaxy young, Android version 2.3.6) suitable for this purpose? And what equipment is needed for computer parts?Earthward
If your phone has Wifi, it definitely is doable. Here is an example of to implement a TCP server in Android (see Server Side Application) : lakjeewa.blogspot.fr/2012/03/…. The client will be developped on Windows I guess, using the Qt library on Windows might be a good choice.Pulsatory
Yes my phone has wifi and Qt is much better for me than Java. Thank you very much!!!Earthward
One more question please. What about Hands free profile(SCO)? Can I implement calls with it?Earthward
Look at this SO response, you might be interested : #6184394. So yes, you can stream to another HFP device, but probably not from a HFP device to Android.Pulsatory
I mean use PC as HFP device(if it is possible) and instantiate connection over HFP between PC and Android phone.Earthward
I said above, yes you could use your PC as an HFP sink (receives sound) and your Android phone as a HFP source (streams sound to your PC).Pulsatory
Not a feature I'm aware of, no. The purpose of Bluetooth capabilities in phone or a tablet is mainly to stream audio to a headset or to an external speaker, it has no sense to stream audio from a source to the speakers of a phone, thus the lack of this feature on Android.Pulsatory

© 2022 - 2024 — McMap. All rights reserved.