!7 import javax.sound.sampled.*; static /*Target*/Line currentLine; p-substance { final L lines = allAudioLines(); L lineNames = allToString(lines); ButtonGroup buttons = showUnselectedRadioButtons("All 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 = line.open(); Control[] controls = line.getControls(); for i over controls: print("Control " + (i+1) + ": " + controls[i]); if (currentLine instanceof DataLine) thread { print("Capturing"); captureAudioFromLine((DataLine) currentLine, sphinxAudioFormat()); print("Capture done"); } }); }