public void capture() {
		final Getoptions opt = new Getoptions();

		try {
    	    final AudioFormat format = getTransmissionFormat();
    		DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
    	    final TargetDataLine line = (TargetDataLine)AudioSystem.getLine(info);
    	    line.open(format);
    	    line.start();
    	    Runnable runner = new Runnable() {
    	    	int bufferSize = (int)format.getSampleRate()  * format.getFrameSize();
    	        byte buffer[] = new byte[bufferSize];

    	        public void run() {
    	        	Wuuii.out = new ByteArrayOutputStream();
    	        	opt.setRecord(true);
    	        	try {
    	        		while (opt.getRecord()) {
    	        			int count = line.read(buffer, 0, buffer.length);
    	        			if (count > 0) {
    	        				Wuuii.Spectrum(buffer, format, Wuuii.recvCapture);
    	        				Wuuii.out.write(buffer, 0, count);
    	        			}
    	        		}
    	        		Wuuii.out.close();
    	        	} catch (IOException e) {
    	        		ErrorMessage error = new ErrorMessage("I/O problems: " + e);
    	        		error.EMessage();

    	        	}
    	       }
    	    };
    	    
    	    Thread captureThread = new Thread(runner);
    	    captureThread.start();
    	} catch (LineUnavailableException e) {
    		ErrorMessage error = new ErrorMessage("Line Unavailable: " + e);
    		error.EMessage();	
    	}
    }