!7 import javax.sound.sampled.*; p-tt { //AudioFormat format = new AudioFormat(8000.0f, 16, 1, true, true); AudioFormat format = new AudioFormat(8000.0f, 8, 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; int bufSize = microphone.getBufferSize(); print("Mic buffer size: " + bufSize); byte[] data = new byte[bufSize/5]; microphone.start(); int bytesRead =0; while (bytesRead < 10000) { //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(); psl(splitArrayRegularly(out.toByteArray(), 32)); }