@Override
    public void run() {
        System.out.println("asa1");
        byte[] data=new byte[1024];
        BufferedOutputStream captureOutputStream = null;
        try {
            captureOutputStream=new BufferedOutputStream(socket.getOutputStream());
        } catch (IOException ex) {
            return;
        }
        try {
            speak.start();
        } catch (Exception ex) {
            Logger.getLogger(tranSound.class.getName()).log(Level.SEVERE, null, ex);
        }
        int numBytesRead=0;
        while(thread!=null)
        {
            try {
                numBytesRead=stream.read(data);
                captureOutputStream.write(data,0,numBytesRead);
            } catch (IOException ex) {
                Logger.getLogger(tranSound.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        speak.close();
        try {
            captureOutputStream.flush();
            captureOutputStream.close();
        } catch (IOException ex) {
            Logger.getLogger(tranSound.class.getName()).log(Level.SEVERE, null, ex);
        }
        

        
    }