Hi
@Star-Dust , I've developed a similar project some time ago, but I use ESP8266 and ESP32 that read audio wave from microsd card and stream it over UDP to Android (B4A) or desktop devices, PC and Raspberry Pi (B4J) or another ESP8266 with external i2S audio DAC. Tried it not only in local network but even over internet from one city to other city and works pretty well. I will release the full (Arduino IDE, B4A, B4J) projects next days.
I wànt suggest that you can receive the UDP stream even with VLC or Netcat, with last on Linux you can pass directly the audio stream to the linux ALSA driver and then use AudioJack to route it to other applications and even use audio plugins to process it in realtime, like equalizer, reverb, delay and so... or just to record it eg. with Audacity, Ardour etc...
On linux using VLC to receive the audio stream I use the follow command on terminal that start an UDP server that listen to:
vlc --demux=rawaud --rawaud-channels=2 --rawaud-samplerate=44100 udp://@:8266
I've used port 8266, you can chànge it and other parameters as you need based on the trasmitter
Using Netcat the follow command pass the received audio stream to the linux ALSA driver to be routed to other applications using AudioJack or even to PulseAudio:
nc -u -p 8266 --l | play -t raw -r 44100 -b 16 -c 2 -e signed-integer -
The ESP8266 receiver as I wrote, receives the audio stream and send to external audio DAC, then the audio will go to headphones or RCA LR connected to the amplifer, as DAC I've used the Raspberry Pimoroni PHAT DAC, the ESP8266 i2S API permits max 16 bits audio (so no 24 bits), I will try next days on ESP32 that have a better i2S API and support 2 I2s ports with configurable pins and a 24 bits audio up 192Khz, I think this not a problem because I've wrote an audio library for ESP8266 and ESP32, for the first tested and works well, for the last I just need to test by connecting the DAC.
My code can stream up 192Khz 16 bit Stereo audio, but the max quality I've tried successfully is 96Khz 16 bits Stereo that is high quality audio too, I think this is a limitation of ESP8266 that read the audio from microsd and not anyway referred to the network bandwith.
In my implementation one device work as trasmitter and other as receiver, not fullduplex, an interesting solution is to use both on both side, like a walkie-talkie or network audio call, on this direction I've wrote a fast hardware optimized library for SSD1331 (96x64) RGB color small 0.95 inch oled for ESP8266 and ESP32 capable to play videos with very high framerate, up 140 FPS without audio or up 24 FPS with 44100 16 bits audio (with DAC attached) and using ESP32-CAM, i2S DAC, i2S mic etc... I want to implement an UDP video call (Audio + Video) over network between two ESPs or ESP-Desktop devices.
I noticed you warn up users for some missed packets using UDP protocol, from my tests the problem was using a broadcast address to stream to all devices, using an unicastast address I noticed that (at least on my network using FritzBox router) there is a very small amount of missed packets, like 1 missed packet every 30.000 packets, not bad.
I do not use B4R, it is installed but I use very old PCs to develop, with Win XP ?? and I've problems with it, any time I compile it recompile all the code without use a temporary file, so require very long time like the first time I compile on Arduino IDE, after this my systems are 32 bits so I cannot install anyway latest releases of the IDE. Maybe when I release my C++ code for ESP8266 and ESP32 someone interested to port it to B4R.
Please try my suggestion with VLC and Netcat if you use Linux and have some time, even on Raspberry will work, and inform me if you have success with it.
Regards
Massimo from Italy