sending .wav via network

he everyone i' m working in a project
and part of this project is sending .wav file from Arduino to other Device ( for example other Arduino)

i already was able to send .txt file from an SD which was included in the Ethernet Shield
to other Arduino SD card , but it doesn't work when i try to send .wav
any idea ?

void loop() {

if(digitalRead(push1) == LOW){
    writeanddeletSDcard();
      Serial.println("i will send now");
      Udp.beginPacket(destIp, port);
     Udp.write(a);
      Udp.endPacket();
      Serial.println("Sending UDP message");
     
}
}



void writeanddeletSDcard(){
    SD.remove("S13.txt");
   myFile = SD.open("S13.txt", FILE_WRITE); // boolean 
   data = myFile.size();
  // if the file opened okay, write to it:
  if (myFile) {
    Serial.println("i will Write now ");
    delay(2000);
    Serial.println(data);
    myFile.println("HELLO WORLD");
    myFile.close();
   
    // close the file:
  }
else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");}
   
    
// ---------------- here end of Writing an a massege on the SD Card
  // re-open the file for reading:
  myFile = SD.open("S2.WAV");
  if (myFile) {
    Serial.println("inside the file there's");

c= 0 ;
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      a[c] = myFile.read();
      c++;  
    }
    Serial.println(c);
    
    // close the file:
    myFile.close();
  } else {
   // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
 }

}

but it doesn't work when i try to send .wav

The snippet does something. You expect it to do something. I think it's safe to assume that those two somethings are not the same thing. But, what either one is is a mystery.

It is unlikely that the entire way file will fit in memory at one time.

The write() method expects a byte or an array AND a size. If you pass an array without a size, the write() method will stop when it encounters the first 0 in the array.