ESP32-audioI2S
ESP32-audioI2S copied to clipboard
add audio_webfile_start/audio_webfile_data_received/audio_stopped callbacks
Adds the following callbacks:
void audio_stopped(const uint32_t pos) // called after audio has stopped
void audio_webfile_data_received(const uint8_t *writePtr, const int16_t bytesWritten) // called after data has been received from a web file stream
void audio_webfile_start(const bool isTTS, const char *lastHost) // the webfile stream starts
And adds the existing audio_eof_stream callback to the readme
What can you use it for?
I'm using it to stream webfiles and save them to SD while playing.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
I've rebased the PR. Do you have any alternative suggestion for the use case?
Might be useful to cache TTS. For example I use TTS to get notified about Home Assistant TTS events.
Imagine you have TTS notifications like "Hey, a movement has been detected in basement". Instead of asking for TTS sentence, it can be cached using md5 of the sentence adding the language as salt.
Seems like a good feature candidate anyway.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
@schreibfaul1 any comment on this? If you plan to merge it, I'll rebase it on master again.
you can query isRunning()
you can query
isRunning()
That doesn't give me access to the input buffer and we would have to use busy waiting (inefficient) to get something similar to the webfile_start/stopped callback.
Are your concerns only with the webfile_start and stopped callback?
It would be really useful to have events when audio connection has been started or stopped so that one could enable/disable leds based on these events for example.