Trimming Audio in the Browser: Waveforms, Selections and Lossless WAV
August 22, 2026 · DevTools
Trimming Audio in the Browser: Waveforms, Selections and Lossless WAV
Cutting 30 seconds of dead air from a voice memo shouldn't involve uploading it to a converter site. The Audio Trimmer does the whole job locally: decode, visualize, select, export.
From file to waveform
The browser's AudioContext.decodeAudioData turns any format it understands — MP3, WAV, M4A/AAC, OGG, FLAC — into raw PCM samples. From those, the tool computes 600 amplitude peaks (the loudest sample per bucket) and paints them as a two-sided bar waveform: teal for the selected span, gray for what's cut.
Selection is the interesting part. Dragging directly on the waveform snaps to whichever edge is nearer; the sliders underneath offer the same control numerically with centisecond timecodes. Enforcing a 10 ms minimum and clamping start/end against each other prevents the classic broken state of "end before start".
Why WAV export is lossless by construction
The trimmed segment is a byte-exact slice of the decoded sample data, written straight into a 16-bit PCM WAV container — 44-byte RIFF header, no re-encoding, no generation loss. Whatever your ears heard in the preview is what's in the file, to the sample.
MP3 export would mean re-encoding (and licensing encoders); it's on the roadmap, not in this version — and WAV plays everywhere anyway.
Limits stated plainly
- Export is mono (first channel) — stereo trimming arrives with the encoder roadmap.
- Selection precision is visual plus 10 ms; sample-exact cutting needs timestamps, which the timecodes approximate well.
- Decoding happens in memory; hour-long files work but big FLACs can take a moment.
The companion pieces in the local audio toolkit: capture with the Screen Recorder, and mix working sound with the Ambient Noise Generator.