!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 instanceof DataLine) try { text += ((DataLine) 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(); print("Line type: " + shortClassName(currentLine)); Control[] controls = currentLine.getControls(); print("Controls: " + l(controls)); for ic over controls: print("Control " + (ic+1) + ": " + controls[ic]); if (currentLine instanceof DataLine) thread { print("Capturing"); captureAudioFromLine((DataLine) currentLine, sphinxAudioFormat()); print("Capture done"); } }); }