Repair audio (denoise, declick, dehum)
audio_repairRepairs noisy or damaged recordings by removing clicks, crackle, clipping, hum, hiss, background noise and reverb, using explicit stages, restoration presets or automatic defect analysis.
Instructions
Repairs recordings: declip, declick, decrackle, dehum (50/60 Hz mains hum), denoise (hiss, background noise) and dereverb, as explicit stages, as a restoration preset (vinyl, tapeHiss, fieldRecording, voiceMemo, shellac78), or automatically from a defect analysis (auto: true); dereverb can be tuned to the measured room (dereverb_from_room). Use it after audio_diagnose, whose suggested_stages it takes unchanged; it is the one tool that accepts any channel count. Do not use it for creative effects (use audio_process), loudness mastering (use audio_master) or to only detect problems (use audio_diagnose). Example: {"path": "interview.wav", "stages": [{"stage": "denoise", "params": {"reductionDb": 12}}, {"stage": "dehum"}]}.
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": {
"path": "<path>"
},
"name": "audio_repair"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | Measure the defects and apply the stages the analysis recommends. | |
| path | Yes | Input audio file; any channel count. | |
| range | No | Only process this window {start_sec, end_sec}; the output contains just the window. An end_sec past the end is clipped (reported in warnings). Default: the whole file. | |
| 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. | |
| preset | No | Restoration preset: vinyl, tapeHiss, fieldRecording, voiceMemo or shellac78 (a full restoration master; mono or stereo only). | |
| stages | No | Explicit repair stages, e.g. [{stage: 'denoise', params: {reductionDb: 12}}]. audio_diagnose's suggested_stages can be passed unchanged. | |
| 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. | |
| dereverb_from_room | No | Measure the room of the recording and use its measured reverberation time and late delay for the dereverb stage; values with no measurement keep the defaults. The stage's other settings are kept. Needs a dereverb stage in 'stages' or an 'auto' run that recommends one. |