Detect silence in a file
detect_silence_in_fileDetect silent and non-silent audio ranges in a media file to identify cut points for removing silence or tightening edits.
Instructions
Find the silent parts of a media file's audio (ffmpeg silencedetect). Returns silent ranges and the complementary non_silent ranges, each as {start, end, duration} in file time (seconds from the start of the file), plus counts and total seconds. Typical use: analyse the source file of a clip, then cut the silent ranges out of the timeline with extract_range or razor_at_times (for a clip at 100 % speed: sequence time = clip start + file time - clip in point). A part counts as silent when every channel stays below noise_db for at least min_duration. Use padding to keep a little room around speech. Fails with NO_AUDIO for a file without sound. 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": "detect_silence_in_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. | |
| padding | No | Seconds of each silence to give back to the surrounding sound on both sides, so cuts do not clip the start or end of words. Default 0. | |
| noise_db | No | Level below which audio counts as silence, in dBFS. Default -30. Use about -40 for clean studio recordings, -25 for noisy rooms. | |
| max_results | No | Maximum ranges per list to return. When there are more, the result has truncated=true and the total count. Default 500. | |
| audio_stream | No | Which audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0. | |
| min_duration | No | Shortest silence to report, in seconds. Default 0.5. | |
| timeout_seconds | No | Stop ffmpeg and fail with TIMEOUT after this many seconds. Default 300. | |
| min_non_silent_duration | No | Drop non-silent ranges shorter than this many seconds (clicks, pops). Default 0. |