Send wav file using udp node

Hello everyone!
So I have a wav file that I want to send via udp. How can it be? Thank you very much for the answers! I'm trying this, but it doesn't work:

[{"id":"6e4886616b135e02","type":"inject","z":"f41a27cc00143f05","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":330,"y":780,"wires":[["436ceb41482997b2"]]},{"id":"436ceb41482997b2","type":"file in","z":"f41a27cc00143f05","name":"","filename":"/home/xy/UDP_I2S/xy.wav","filenameType":"str","format":"stream","chunk":false,"allProps":false,"x":520,"y":780,"wires":[["65b5debe20a1b53c"]]},{"id":"da9165b28ec524b9","type":"inject","z":"f41a27cc00143f05","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":1010,"y":840,"wires":[["65b5debe20a1b53c"]]},{"id":"65b5debe20a1b53c","type":"sox-record","z":"f41a27cc00143f05","name":"","buttonStart":"msg","inputs":1,"inputSource":"fromInput","manualSource":"","inputEncoding":"signed-integer","inputChannels":"2","inputRate":"44100","inputBits":16,"byteOrder":"-L","encoding":"signed-integer","channels":"2","rate":"44100","bits":16,"gain":"0","buffer":"1024","showDuration":false,"durationType":"forever","durationLength":"0","silenceDetection":"nothing","silenceDuration":"2.0","silenceThreshold":"2.0","outputFormat":"stream","manualPath":"1","debugOutput":false,"x":1190,"y":780,"wires":[["a5b74c1f7531d507"],[]]},{"id":"a5b74c1f7531d507","type":"udp out","z":"f41a27cc00143f05","name":"","addr":"192.168.28.151","iface":"","port":"40000","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":1460,"y":780,"wires":[]}]

not sure what the sox node is used for here - but you should be able to just wire the output for the file node to the udp node.

Unless this is a streaming format - you don't!

UDP has no guarantee of packet order, so you will likely get corrupted files + UDP has a max packet length, and your routing equipment, can decide to drop packets also.

Use TCP for this kind of transfer, unless you are streaming the WAV (in which case you will need to transcode I think)

An INMP441 microphone is connected to an ESP32 PoE, I send it via UDP, a python code receives it and then saves it as a wav file. I want to send this wav file from node red via udp

As mentioned by @dceejay

Just wire the read file node output to the udp out node - but again, because UDP is stateless, and has no ACK you may need to devise your own checksum routines to ensure the file is in intact at the other end - if its critical to your application.

You could UDP the checksum, and check it at the other end after the transfer.

Whilst.... unlikely (sorry I know i'm back tracking) - it's absolutely possible for packet loss or the order of packets to become out of sync when using UDP

udp : Error: send EMSGSIZE 192.168.5.151:40000

You need to cut the buffer into pieces (more so with UDP), and send them in chunks

Well, I'm still not enough for that :pensive:

The reason :point_up: works...

Is because (well at least I am guessing) the python code is receiving a "stream" of small bytes from the mic signal - and not a massive file blob.

Sorry, I would help further, but I'm done for the day - hopefully others can chip in