audio_capture
Capture audio output from live Strudel sessions. Start streaming, stop and return base64-encoded audio, or sample a fixed duration window.
Instructions
Record audio output from the live Strudel session. action=start begins streaming capture (optional format webm/opus, default webm). action=stop ends the stream and returns base64-encoded audio. action=sample captures a fixed-duration window in one call (100-60000ms, default 5000ms). Example: audio_capture({ action: "sample", duration: 3000 }). Audio must be playing for capture to record meaningful data. For MIDI export use export_midi; for runtime diagnostics use diagnostics. Note: the AudioCaptureService is currently a server-wide singleton — concurrent captures across sessions will conflict.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Capture action | |
| format | No | action=start: audio format (default webm) | |
| maxDuration | No | action=start: maximum capture duration ms | |
| duration | No | action=sample: duration ms (100-60000, default 5000) | |
| session_id | No | Optional session ID (#108). Routes page reference to the named session. Note: AudioCaptureService is currently server-wide — concurrent captures across sessions will conflict. |