3
votes

I need to stream audio over Windows sockets to a bluetooth headset. I am able to make socket connection to the Bluetooth headset using RFCOMM and A2DP / Headset profile / Hands-free profile. My requirement is to stream audio (WAV or MP3) over the socket. Is it possible by simply writing audio data to the socket (using send())? OR any other ways to do it?

I am required to use the same socket connection to stream. If I use Media Control Interface APIs, they will make a separate connection and then stream.

1

1 Answers

0
votes

The A2DP profile is layered on top of L2CAP and SDP; moreover SDP shall function while using L2CAP as its transport protocol.

So if you want to implement the communication with send(s) through a socket, you need to implement SPD also, and you should realize the communication as specified in

https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=8236

after you have connected serially to your A2DP capable device, like i. e. using:

http://SimpleBluetooth4Win.Sourceforge.net

(small library that uses the windows bluetooth networking API)