# Trim Music

A local tool that finds long silence at the start or end of MP3 files and trims it with fades. A small web page shows a waveform for every track, with draggable cut points to review each cut before it is applied. The original is always kept beside the new file.

- **Facts:** 2026, Personal project, Completed, role: Sole developer
- **What I did:** I wrote the whole tool alone, for my own use: the detection rules, the server and the interface.
- **Scope:** fullstack
- **Domain:** media
- **Stack:** Python, JavaScript, HTML, CSS, Canvas API, FFmpeg, Claude Code
- **Page:** https://sergey-petrinich.vercel.app/work/trim-music
- **Screenshot:** https://sergey-petrinich.vercel.app/work/trim-music.webp

Capabilities:

- Folder of MP3 files scanned, each side of a track judged on its own
- Quiet stretches split by a short loud burst merged into one, so breathing intros and outros are found
- Track flagged only when the merged stretch is long enough and touches the start or the end
- Waveform per track drawn on a canvas, with the part to be cut tinted
- Draggable cut points with live time labels, and buttons to add or remove a cut on either side
- Playback from any point of the waveform, and a space bar to pause
- Flagged tracks first and ticked, clean tracks last and unticked, none hidden
- Original renamed with a visible prefix instead of deleted
- Fade in and fade out on every cut
- Rename retried when Windows holds a file, and rolled back if encoding fails
- Trim one track or every ticked track in a row
- Standard library HTTP server with no framework, scan streamed track by track as each analysis finishes, audio served with byte ranges

Back to the [work archive](https://sergey-petrinich.vercel.app/work.md) · [CV](https://sergey-petrinich.vercel.app/cv.md) · [all of it in one file](https://sergey-petrinich.vercel.app/llms-full.txt)
