public AudioClient (Socket socket){ //put in socket with server address
       try {
        sampleRate = 44100;
		int sampleSizeInBits = 16;
		int channels = 1;
		boolean signed = true;
		boolean bigEndian = false;
		format = new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
		DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, format);
		bufferSize = (int) format.getSampleRate() * format.getFrameSize();
		buffer = new byte[bufferSize];
		
		targetDataLine = (TargetDataLine)AudioSystem.getLine(dataLineInfo);
			targetDataLine.open(format, (int)sampleRate);
			targetDataLine.start();
		
            OutputStream out = socket.getOutputStream();
                while (isRunning) {
                    targetDataLine.read(buffer, 0, buffer.length);
                    out.write(buffer);
                }
            
            socket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }