# How can I send a .wav file from a Processing client to a Python server?

**URL:** <https://discourse.processing.org/t/how-can-i-send-a-wav-file-from-a-processing-client-to-a-python-server/40913>\
**Category:** Libraries\
**Created:** [February 13, 2023, 2:59pm UTC](https://discourse.processing.org/t/how-can-i-send-a-wav-file-from-a-processing-client-to-a-python-server/40913 "2023-02-13T14:59:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro199762](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Alessandro199762](https://discourse.processing.org/u/Alessandro199762)\
**Post date:** [February 13, 2023, 2:59pm UTC](https://discourse.processing.org/t/how-can-i-send-a-wav-file-from-a-processing-client-to-a-python-server/40913/1 "2023-02-13T14:59:45Z")

</div>

Hello.  
As stated in the header, i need to send a file .wav (but i think any method is suitable for any file) from a processing client to a python server which processes the file and sends it back to the processing client.  
Up to now this is my very simple code which i took from a demo found on the processing website:

```auto
import processing.net.*;
import java.io.FilenameFilter;

String[] filenames;
String fullPath = "C:\\Users/aless/Desktop/client_server_prova/Client_processing/client_processing/file_audio";

Client myClient;
     
void setup() { 
    size(200, 200);
    filenames = loadFilenames(fullPath);
    
    /* Connect to the local machine at port 50007
     * (or whichever port you choose to run the
     * server on).
     * This example will not run if you haven't
     * previously started a server on this port.
     */
    myClient = new Client(this, "127.0.0.1", 50007);
    
    myClient.write(filenames[0]);
    
    // DEBUG
    //myClient.write("Paging Python!");    
    //print(filenames[0]);
    // FINE DEBUG
} 
     
     
void draw() { 
    //myClient.write("Paging Python!"); // send whatever you need to send here
    
} 

String[] loadFilenames(String path) {
  File folder = new File(path);
  FilenameFilter filenameFilter = new FilenameFilter() {
    public boolean accept(File dir, String name) {
      return name.toLowerCase().endsWith(".wav");//|| name.toLowerCase().endsWith(".mp4"); // change this to any extension you want
    }
  };
  return folder.list(filenameFilter);
}

```

the “filenames” stuff is a failed attempt i made.  
If anyone could help me i would be very grateful.  
Thank you very much.
