from max98357 audio data to a2dp_source bluetooth headset #631
-
Problem DescriptionHello, Device DescriptionEsp32-wroom arduino Sketcha2dp_source.start("Galaxy Buds+ (D504)", get_sound_data_from_i2s); Other Steps to ReproduceNo response Provide your Version of the EP32 Arduino Core (or the IDF Version)2.0.14 I have checked existing issues, discussions and online documentation
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
There are plenty of examples in the AudioTools library |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. |
Beta Was this translation helpful? Give feedback.
-
library ? I think you were looking for a sketch from I2S to A2DP. So that would be
You forgot to describe your I2S source device from which you want to read the audio from. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your info. I tryed stream-i2s-a2dp and basic-i2s-a2dp but i cant solved. My example code is below.it's playing a tone every one second. how can i export music at the same time to bluetooth headset. #include <Arduino.h> #define I2S_NUM I2S_NUM_0 const int frequency = 440; void playTone(int freq, int duration_ms) for (int i = 0; i < samples_per_wave; i++) int total_samples = (SAMPLE_RATE * duration_ms) / 1000; free(wave); void setup() i2s_pin_config_t pin_config = { // I2S başlatma void loop() |
Beta Was this translation helpful? Give feedback.
-
You could write to the A2DPStream (from the AudioTools) at the same time when you call i2s_write or you write it into a queue and provide the audio data from there to the A2DP callback. Using the AudioTools you could write to a MultiOutput which sends the audio both to a I2SStream and A2DPStream. ps. why are you still using 2.0.14 ? The actual release is 3.0.7 with 3.1 being released soon! Please also note that there is some considerable lag in A2DP, so you can write it at the same time, but you will not hear it at the same time. Your example would correspond to
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil, #include "Arduino.h" void setup() audio.setVolume(5); } void loop()
} |
Beta Was this translation helpful? Give feedback.
-
Audio library is https://github.com/schreibfaul1/ESP32-audioI2S.git |
Beta Was this translation helpful? Give feedback.
There are plenty of examples in the AudioTools library