Convert or edit audio
audio_editConverts audio between formats and edits it with ordered operations such as trim, cut, fade, gain, normalize, pitch shift and time stretch, letting you rewrite a file into a new version in one call.
Instructions
Converts an audio file to another format (wav, flac, ogg, opus, mp3, aiff, m4a; bit depth, quality, sample rate) and/or edits it with an ordered list of ops: trim, cut, fadeIn, fadeOut, gain, normalize (peak, rms, lufs), resample, channels (mono, stereo, left, right, swap), reverse, pad, repeat, trimSilence (peak or lufsGated), dcRemove, pitchShift (pitch_semitones or to_key), timeStretch (speed_ratio, tempo_bpm or duration_sec), moveRegion and stretchRegion (one note or phrase), rearrange (rebuild from slices of the audio), editHits (move, level or mute percussive hits) and spectralEdit (change a time x frequency rectangle). Text tags are carried over. Use it for 'convert to mp3', 'cut from 30 s to 60 s', 'fade out the last 3 seconds', '-3 dB' or 'make it 90 BPM'; ops: [] is a pure conversion. Do not use it for EQ, compression or effects (use audio_process), loudness mastering with a true-peak ceiling (use audio_master), joining several files (create a project with project_create layout "sequence" and render it with project_render) or cutting into several files (use audio_split). Example: {"path": "song.wav", "ops": [{"op": "trim", "start_sec": 30, "end_sec": 60}, {"op": "fadeOut", "duration_sec": 3}], "format": "mp3"}.
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_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | No | Operations applied in order, each an object with an 'op' name plus its fields: trim, cut, fadeIn, fadeOut, gain, normalize, resample, channels, reverse, pad, repeat, trimSilence, dcRemove, pitchShift, timeStretch, moveRegion, stretchRegion, rearrange, editHits, spectralEdit. Times (start_sec, end_sec) refer to the audio as it is when the op runs. An empty list only converts the file to the format, bit depth, quality, sample rate and name given by the write arguments. | |
| path | Yes | Input audio file (wav, flac, mp3, ogg, aiff, ...). | |
| 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. |