public void run() {
            try {
                AudioFileFormat.Type fileType = getFileType();
                File audioFile = getAudioFile();
                open();
                AudioSystem.write(new AudioInputStream(getTargetDataLine()), fileType, audioFile);
                //Will write to File until it's closed.
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }