Normalize loudness
normalize_loudnessCreate a loudness-corrected copy of an audio or video file: apply exact gain when it meets true-peak limits, otherwise use two-pass dynamic loudness normalization to hit LUFS and peak targets.
Instructions
Write a loudness-corrected copy. The file is measured first; if a plain gain change reaches the target without exceeding the true-peak ceiling, exactly that gain is applied (linear, dynamics untouched). Otherwise ffmpeg's two-pass dynamic loudnorm is used to hit both targets. Pick a target preset or give custom integrated LUFS / true-peak / LRA values. For video files the video stream is copied untouched. The result is re-measured. Never overwrites without overwrite: true.
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": "normalize_loudness"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a local audio or video file. ~ is expanded. | |
| linear | No | Prefer an exact gain change (keeps your mix's dynamics). If that would push true peak over the ceiling, dynamic loudnorm is used instead and the result explains why. | |
| lra_lu | No | Target loudness range used in dynamic mode. | |
| target | No | Preset target. Ignored when integrated_lufs is given. | |
| dry_run | No | Measure and return the pass-2 command without writing. | |
| overwrite | No | ||
| output_path | No | Output file; the extension picks the codec (.wav 24-bit, .flac, .mp3 320k, .m4a/.mp4/.mov AAC 256k, .opus). Defaults to <name>_<target>.<ext> next to the source. | |
| sample_rate | No | Output sample rate. Defaults to the source rate (or 48000). | |
| audio_stream | No | ||
| true_peak_dbtp | No | Custom true-peak ceiling. | |
| integrated_lufs | No | Custom integrated loudness target. |