This blog continues the topic Low Latency Streaming of Audio Data and we have a closer look at ESP-NOW. This is a protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi.

I was missing a proper implementation that is based on Arduino Streams, so I have added one to my Arduino Audio Tools Library.

Here are the related example Arduino sketches:

When I was doing my tests, I first noticed that some audio data gets lost on the receiving side and it took quite some time until I figured out that I need to a blocking write to the buffer (and wait until enough memory is available again). The stream read is nice to have so that we have a consistent interface, but in real life it is much more efficient to provide a callback in the config where we e.g. just do a blocking write to i2s.

I was measuring 33000 to 37000 bytes per second which gives 16500 samples/second in mono and 8250 samples per second in stereo. This is good enough for some basic audio but insufficient for HIFI music.

So the conclusion here is as well, that we should use a low latency codec which is compressing audio. So in my next blog we start to have a look at potential codecs.


1 Comment

Patapom · 8. August 2024 at 21:39

Hi! I did try to send audio using broadcast and 5.5 Mbps and I managed to send uncompressed 44.1KHz 16-bits stereo with only 7% packets lost…
Going down to 22 KHz (or compressing to 50%), I managed to get only 1% packets lost.
Maybe your bandwidth limitations come from the fact that you wait for packet ack and retransmits?

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *