public void captureAudio() {

		// request name of file to be captured
		wavName = JOptionPane.showInputDialog(null,
				"enter name of file to be recorded:");

		try {
			// Get and display a list of
			// available mixers.
			Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
			System.out.println("Available mixers:");
			for (int cnt = 0; cnt < mixerInfo.length; cnt++) {
				System.out.println(mixerInfo[cnt].getName());
			}// end for loop

			// Get everything set up for capture
			audioFormat = getAudioFormat();

			DataLine.Info dataLineInfo = new DataLine.Info(
					TargetDataLine.class, audioFormat);

			// Select one of the available
			// mixers.
			Mixer mixer = AudioSystem.getMixer(mixerInfo[1]);

			// Get a TargetDataLine on the selected
			// mixer.
			targetDataLine = (TargetDataLine) mixer.getLine(dataLineInfo);
			// Prepare the line for use.
			targetDataLine.open(audioFormat);
			targetDataLine.start();

			// Create a thread to capture the microphone
			// data and start it running. It will run
			// until the Stop button is clicked.
			Thread captureThread = new CaptureThread();
			captureThread.start();
		} catch (Exception e) {
			System.out.println(e);
			System.exit(0);
		}// end catch
	}// end captureAudio method