Cut the quiet
An audio processing tool that automatically trims MP3 files by detecting a clap spike at the beginning and removing leading/trailing silence. Designed for processing voice recordings (lectures, interviews, etc.) marked with a clap to indicate the start.
- Detects a loud clap spike in the first 30 seconds of audio
- Removes everything before the clap (plus a configurable buffer)
- Identifies and removes silence after the clap
- Removes trailing silence from the end
- Adds small padding (50ms) for natural boundaries
- Python 3.13+
- ffmpeg
# macOS
brew install ffmpeg# Process all MP3 files in current directory
python3 trim_audio.py
# Process specific files
python3 trim_audio.py file1.mp3 file2.mp3
# Custom output directory
python3 trim_audio.py -o ./output
# Adjust sensitivity
python3 trim_audio.py --silence-thresh -35 --min-silence 500| Flag | Default | Description |
|---|---|---|
input |
all .mp3 in cwd |
MP3 file(s) to process |
-o, --output-dir |
trimmed_<timestamp> |
Output directory |
--silence-thresh |
-40 |
Silence threshold in dB |
--min-silence |
300 |
Minimum silence duration in ms |
--clap-duration |
200 |
Expected clap duration in ms |
Output files are saved to a timestamped directory (trimmed_YYYYMMDD_HHMMSS/) by default, preserving original filenames.
This project is licensed under the GNU General Public License v3.0.