Closed utkutpcgl closed 3 years ago
Hi, How about this?
static int writeToEspnowSendBuffer(audio_element_handle_t el, char *buf, int len, TickType_t wait_time, void *ctx)
{
char *buf = (char *)ctx;
int bytes_read = rb_write(consume_ring, (char *)buf, len, portMAX_DELAY);
return bytes_read;
}
You run a task to receive consume_ring ringbuf data, is this kind of response useful to you?
Dear esp-adf team,
I want to send the output data of an audio element (amr encoder output data) with espnow whenever the output data of the encoder is ready. I use
audio_element_output()
inside the callback function I defined withaudio_element_set_write_cb()
.For example:
audio_element_set_write_cb(amrEncoder, writeToEspnowSendBuffer , NULL);
Right after I call output on encoder I expect the output data to be transferred to my buffer or at least a ringbuffer. How can I do this? I will use this encoder output later for real-time sound communication. I will transmit the sound data coming out of amr encoder whenever it is ready. Hence, I must use an interrupt here. What is the proper way. I use espnow to send the sound data and the receiver needs real time sound data (output of amr encoder).
Thanks in advance. Kind regards.