Replies: 3 comments 2 replies
-
Also, during testing, I found that when I turn on the ESP32 for the first time BEFORE establishing a Bluetooth connection, my method works. After connecting via Bluetooth and while playing something via Bluetooth, my method also works. But as soon as I pause the music (without breaking the connection), my method stops working and the recorded signal does not play back. |
Beta Was this translation helpful? Give feedback.
-
I don't quite understand: what is the point of this ? Why don't you use a i2s.write() directly ? |
Beta Was this translation helpful? Give feedback.
-
Currently you can call e.g. set_stream_reader(nullptr, flag); to update the i2s_output flag. |
Beta Was this translation helpful? Give feedback.
-
Good afternoon, I was very interested in playing back audio stored in FLASH memory using BluetoothA2DPSink. I managed to solve my problem as follows:
bool is_output = true;
from protected to public (which is very bad).virtual size_t write_audio(const uint8_t *data, size_t size)
from protected to public.size_t BluetoothA2DPSink::i2s_write_data(const uint8_t *data, size_t item_size)
I commented out the checkif (!is_output) return item_size;
.This way I managed to get my own audio playback (even without AudioTools).
(StarWars30.h from your project's examples was taken as an example).
This code works simultaneously with
a2dp_sink.start("name")
and does its job perfectly. The Bluetooth sound is muted, then a fragment of audio is played back, then the Bluetooth sound is resumed.Is it possible to modify your library in such a simple way? So that it would be possible to play your audio by interfering with the Bluetooth stream (without conflicts).
I would create Pull Request myself, but I'm sure that I may not know many nuances and consequences of my modifications (especially since they are not quite correct and made for the sake of experimentation). Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions