Small delay in streaming-i2s-i2s #1927
-
I have an XIAO ESP32-S3, INMP441 and MAX98357A, with it streaming the i2s from the mic, directly to the amp. There is a very slight delay, maybe a 10th of a second, from when a sound is made, like speaking or tapping on the mic, until it's played. I've already changed the logger to 'Error', but it didn't make a difference. The code I'm using is the library's example, with the only changes being the pin numbers and log level. What else can I try to reduce, or even better, eliminate the delay? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The delay is caused by the i2s buffer: which is defined by buffer_size * buffer_count in the config. Just make this buffer smaller ! |
Beta Was this translation helpful? Give feedback.
-
This is correct? auto config = i2s.defaultConfig(RXTX_MODE); |
Beta Was this translation helpful? Give feedback.
-
Reduced it to a buffer_size of 64 and the delay is almost unnoticeable now. Thank you! |
Beta Was this translation helpful? Give feedback.
The delay is caused by the i2s buffer: which is defined by buffer_size * buffer_count in the config.
Just make this buffer smaller !