!7 import javax.sound.sampled.*; static /*Target*/DataLine currentLine; p-substance { final L lines = allTargetDataLines(); L lineNames = allToString(lines); ButtonGroup buttons = showUnselectedRadioButtons("Input Audio Lines", lineNames); JFrame frame = minFrameWidth(300, packFrame(buttons)); final JLabel lblLevel = jcenteredBoldLabel("Level: "); addToWindowAndPack(frame, lblLevel); awtEvery(lblLevel, 100, r { S text = "Level: "; if (currentLine != null) try { text += currentLine.getLevel(); } catch e { text += str(e); printStackTrace(e); } lblLevel.setText(text); }); onRadioButtonChange(buttons, voidfunc(int i) { if (i < 0) ret; AudioLine line = lines.get(i); currentLine = (DataLine) line.open(); thread { print("Capturing"); captureAudioFromLine(currentLine, sphinxAudioFormat()); print("Capture done"); } }); }