Measure peak and average level
measure_volume_of_fileMeasures a media file's audio sample levels via ffmpeg, returning peak/RMS dBFS and headroom to check clipping risk and set gain.
Instructions
Measure the plain sample level of a file's audio (ffmpeg volumedetect): max_volume_db is the highest sample peak in dBFS (0 = full scale, clipping risk), mean_volume_db the RMS level in dBFS. Also returns headroom_db, the gain that would bring the peak to 0 dBFS. Faster than measure_loudness_of_file, which is the tool for LUFS delivery targets. Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.
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": "measure_volume_of_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Analyse up to this file time, in seconds; clamped to the file's length. Must be greater than start. Default: the end of the file. | |
| path | Yes | Absolute path of the media file on this computer. | |
| start | No | Analyse from this file time (seconds from the start of the file). Default 0. | |
| audio_stream | No | Which audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0. | |
| timeout_seconds | No | Stop ffmpeg and fail with TIMEOUT after this many seconds. Default 600. |