!7 lib 1009770 // tritonus share lib 1009766 // tritonus AudioOutputStream import org.tritonus.share.sampled.file.*; import org.tritonus.sampled.file.*; static JButton btn; static new Flag flag; // stop flag p { final File wavFile = prepareProgramFile("recorded.wav"); final AudioFormat format = javaSound_monoCDQuality°; TSeekableDataOutputStream dataOut = new(wavFile); final AudioOutputStream audioOut = new WaveAudioOutputStream( format, AudioSystem.NOT_SPECIFIED, dataOut); final OutputStream out = new OutputStream { public void write(int b) throws IOException { audioOut.write(new byte[] { (byte) b }, 0, 1); } public void write(byte[] b) throws IOException { audioOut.write(b, 0, l(b)); } public void write(byte[] b, int o, int l) throws IOException { audioOut.write(b, o, l); } }; thread { captureAudioFromLine3(format, out, flag); print(wavFile); print("Actually done. " + l(wavFile)); } swing { showControls(jcenteredline(btn = jbutton("Stop", f stop))); } } svoid stop { disableButton(btn); flag.raise(); }