How to get sound data from mic on bluetooth headset? #283
-
I am trying to implement a walkie-talkie type functionality with an ESP32, arduino-audio-tools and a bluetooth headset. Here is my intended topology:
I can probably figure out using the arduino-audio-tools what other copier stream, etc. classes to use for the other links, but what is the class to read the bluetooth headset microphone? I don't see any info on how to read the sound data from a bluetooth headset's microphone and process it. Or is this functionality just not implemented yet? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
A walkie-talkie can send and receive audio: You can't do this with Bluetooth A2DP (which is mainly used to stream music), so your architecture will not work. If you want to send audio in 2 directions I suggest that you either use TCP/IP or ESP-Now together with a Codec |
Beta Was this translation helpful? Give feedback.
-
I think it's Hands-Free Profile (HFP) |
Beta Was this translation helpful? Give feedback.
-
HFP is quite a mess in ESP32 world, but I did get it to work - even in Arduino IDE (albeit with a custom Arduino ESP32 core). Have a look at my sketch here for an example for A2DP and HFP running at the same time: https://github.com/jokubasver/saab-93NG-bluetooth-aux/blob/master/esp32_a2dp_receiver/src/main.cpp The custom Arduino core is here: https://github.com/jokubasver/esp32-arduino-lib-builder/releases/download/hfp10/esp32-2.0.3.zip The reason for using the custom core is that by default on the official Arduino ESP core, the max connections for HFP is set to zero, therefore no HFP audio can flow. |
Beta Was this translation helpful? Give feedback.
A walkie-talkie can send and receive audio: You can't do this with Bluetooth A2DP (which is mainly used to stream music), so your architecture will not work.
The picture is also confusing because it does not show where each functionality should be working
If you want to send audio in 2 directions I suggest that you either use TCP/IP or ESP-Now together with a Codec