List audio devices, record, capture MIDI or run live-through
audio_deviceList audio and MIDI hardware, record an input to a file, capture MIDI to .mid, or monitor live input through effect chains and voice changers for a set duration.
Instructions
Works with the audio and MIDI hardware of the machine running this server. Every call is bounded: record, captureMidi and liveThrough need duration_sec (at most 600 seconds) and return when it has passed; there is no start or stop. listDevices lists audio inputs, audio outputs and MIDI inputs. record writes an audio input to a new file; captureMidi writes a MIDI input to a new .mid; liveThrough sends an input through a chain or a voice changer to an output, optionally also writing a file. Results name the device used (explicit or default) and give a level summary. Use it when the user asks to record, capture a keyboard or hear live processing. Not for playing a file (audio_play) or offline processing (audio_process). Refused with an explanation while libsonare has no device backend; dry_run shows the planned file without touching a device. Example: {"op": "record", "duration_sec": 10}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"op": "<op>"
},
"name": "audio_device"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | 'listDevices' lists audio inputs, audio outputs and MIDI inputs; 'record' records an audio input to a new file; 'captureMidi' records a MIDI input to a new .mid; 'liveThrough' runs an input through a processing config to an output for duration_sec, optionally also writing a file. | |
| chain | No | For liveThrough: insert chain applied to the input, same steps as audio_process. Give this or voice_change. | |
| detail | No | 'concise' returns the summary and the most useful fields; 'full' returns all. | concise |
| format | No | Output format: wav, flac, ogg (Vorbis), opus, mp3, aiff, or m4a (AAC, needs ffmpeg). Default: the explicit output's extension, else the input's format, else wav. | |
| output | No | Output file path. Default: an auto-named new file '<input stem>.<tool>.<ext>' in the output directory. | |
| dry_run | No | Report the resolved output plan and paths without processing or writing. | |
| quality | No | Lossy encoder setting for ogg/opus/mp3, 0..1 (soundfile compression_level, variable bit rate): 0 = best quality, 1 = smallest file. On 48 kHz stereo music, mp3 0 / 0.3 / 1 is about 192 / 120 / 55 kbit/s (no 320 kbit/s setting), ogg about 330 / 150 / 45 and opus about 510 / 360 / 13. Default 0.3. Excludes bit_depth. | |
| bit_depth | No | PCM bit depth for wav/flac/aiff: 16, 24 or 'float32' (32-bit float; not flac). Default: the input's depth, else 24. Excludes quality. | |
| overwrite | No | Replace an existing output file. Without it an existing file is an error. | |
| sample_rate | No | Output sample rate in Hz; the audio is resampled when it differs. Default: the input's rate. Opus is always 48000. | |
| duration_sec | No | For record, captureMidi and liveThrough (required): how long to run, in seconds, at most 600. The call returns when it is over. | |
| voice_change | No | For liveThrough: the voice changer to run, a preset or a whole document as in audio_vocal's voice_change. Give this or chain. | |
| midi_input_index | No | For captureMidi: MIDI input index from listDevices. Omit for the first MIDI input. | |
| input_device_index | No | For record and liveThrough: audio input device index from listDevices. Omit for the system default input. | |
| output_device_index | No | For liveThrough: audio output device index from listDevices. Omit for the system default output. |