!7 import javax.sound.sampled.*; p { AudioFormat format = new AudioFormat(8000.0f, 16, 1, true, true); TargetDataLine microphone; microphone = AudioSystem.getTargetDataLine(format); DataLine.Info info = new DataLine.Info(TargetDataLine.class, format); microphone = (TargetDataLine) AudioSystem.getLine(info); microphone.open(format); ByteArrayOutputStream out = new ByteArrayOutputStream(); int numBytesRead; byte[] data = new byte[microphone.getBufferSize()/5]; microphone.start(); int bytesRead =0; while (bytesRead < 100000) { //Just so I can test if recording my mic works... numBytesRead = microphone.read(data, 0, data.length); bytesRead += numBytesRead; print("Bytes: " + bytesRead); out.write(data, 0, numBytesRead); } microphone.close(); printStructure(out.getByteArray()); }