micTObt ? mic2monitor and sinus2a2dp work fine #267
-
/* QUESTION: Hallo Herr pschatzmann, micTOmonitor in printBuffer and sinusTOa2dp in get_data_channels work fine. I want to change get_data_channels to work with mic instead of sinus signal, eg. micTOa2dp. I want to hear micro on BT Phone . I get stuck and tried several examples. Any hints would be great! Thanks in advance!! Streaming of sound data with Bluetooth to other Bluetooth device. Copyright (C) 2020 Phil Schatzmann */ #include "Arduino.h" #include "AudioLibs/AudioKit.h" AudioKit kit; #define c3_frequency 130.81 BluetoothA2DPSource a2dp_source; const int BUFFER_SIZE = 1024; // The supported audio codec in ESP32 A2DP is SBC. SBC audio stream is encoded void printBuffer(int len){ void setup() { void loop() { size_t len = kit.read(buffer, BUFFER_SIZE); |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
addendum: I'm using exp32 audio kit V2.2 with ac101 |
Beta Was this translation helpful? Give feedback.
-
I suggest that you have a look at the https://github.com/pschatzmann/arduino-audio-tools project. The https://github.com/pschatzmann/arduino-audio-tools/tree/main/examples/examples-audiokit contains plenty of examples that show how to use the audiokit as input. |
Beta Was this translation helpful? Give feedback.
-
At first sight, the only thing which is not good is the callback: I2S for the Audiokit is already returning the data as needed with 2 channels, so no additinal buffer and conversion should be done: so a
should be sufficient... |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your hint. I changed get_sound_data according to your hint and indeed I hear some noise, but only that, on left and right bt headphone, if I press my finger on left or right kitboard microphone. Speaking to the kitboard microphone produces rustling noice in both bt channels headphone. |
Beta Was this translation helpful? Give feedback.
-
My mistake. The size is in frames and not bytes: see this example |
Beta Was this translation helpful? Give feedback.
My mistake. The size is in frames and not bytes: see this example