How to write silence on no data with BluetoothA2DPSink and callbacks #1905
-
Hello everyone, I'm using an ESP32 as a bluetooth receiver to SPDIF output for an old car. I noticed that the A2DPStream class has a silence_on_nodata attribute that works great, but it also warns that using BluetoothA2DPSink with callbacks would be better. With that, I imagine that I should monitor the esp_a2d_audio_state property, and when it is stopped, I should write silence, similar to the silence_on_nodata method. However, whenever I try to use writeSilence() as in What can I do to fix this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Something does not add up: silence_on_nodata is only relevant for the AudioSource scenario. The only disadvantage of the A2DPStream is that it uses some additional RAM for a queue, so if you run low of RAM you can just activate PSRAM! Maybe you get these issues because the internal DAC is deactivated when the output is stopped. You can prevent this by not defining any output to the BluetoothA2DPSink and do the output yourself in the data callback. |
Beta Was this translation helpful? Give feedback.
Something does not add up: silence_on_nodata is only relevant for the AudioSource scenario.
The only disadvantage of the A2DPStream is that it uses some additional RAM for a queue, so if you run low of RAM you can just activate PSRAM!
Maybe you get these issues because the internal DAC is deactivated when the output is stopped. You can prevent this by not defining any output to the BluetoothA2DPSink and do the output yourself in the data callback.