Trimming clips or cutting middle mistakes on a waveform
Preparing a ringtone, tightening a podcast intro, or deleting an off-mic cough requires sample-accurate cuts rather than guessing blindly at timestamps. An interactive waveform cutter running locally inside browser RAM lets you isolate exact regions visually without sending private tracks to external servers.
Choosing Keep selection versus Cut middle splice mode
When you drop an audio file or click Load sample clip, Audio trim selection waveform renders 140 normalized bars scaled by (peak / max)^0.75 so quiet details remain visible. Clicking Keep selection paints the active span blue and discards everything outside your start and end markers.
Switching to Cut middle turns the selection red, removing that middle mistake and stitching the outer audio back together with a 15 ms linear crossfade splice. If you need fresh voice takes before editing, record fresh voice tracks in this workspace and load the saved WAV or M4A immediately.
Setting Start (ms) and End (ms) markers in 20 ms steps
Compressed tracks such as MP3, M4A, OGG, FLAC, and WebM decode locally through the MDN BaseAudioContext decodeAudioData API, while uncompressed RIFF WAVE files parse directly in JavaScript. Upon load, Start (ms) defaults to 5% of total duration and End (ms) defaults to 75%.
Both range sliders step in 20 ms increments while clamping selections to at least 40 ms wide in the interface. Visual blue boundary lines update along the 1000-unit SVG track so you can align cuts cleanly inside silent gaps between spoken words.
Why do cosine-squared fades and normalization prevent clicks?
Slicing a waveform mid-oscillation creates a vertical voltage step that loudspeakers reproduce as an audible pop or click. Applying gain normalization before cosine-squared fade ramps forces both clip boundaries smoothly to zero amplitude while keeping conversational voice volume consistent and free of digital clipping.
Smoothing clip boundaries with Fade in and Fade out ramps
Every edit passes from UI controls to everyday.worker.ts using the MDN Web Workers API guide so slider updates stay responsive on long recordings. Inside trimAudioClip, Fade in defaults to 80 ms and Fade out defaults to 120 ms, both adjustable up to 2,000 ms.
Rather than a sharp linear ramp, the worker multiplies boundary samples by a squared sine curve (sin^2). That S-shaped fade curves gently into silence at the start and tail, preventing sudden speaker cone snaps even on bass-heavy music intros. When removing dozens of silent pauses instead of single manual mistakes, switch to Remove Silence from Audio.
Comparing Peak (-1 dB) and Speech RMS (-16 dBFS) targets
Selecting Normalize volume lets you choose None (original gain), Peak normalize (-1 dB), or Speech loudness (-16 dBFS). Peak normalization raises or lowers the entire trimmed clip uniformly until the single loudest sample reaches -1 dBFS headroom.
Speech RMS mode targets -16 dBFS average conversational loudness (0.2x to 12x gain clamp) and routes boosted transients through softLimitSample so spikes round off smoothly instead of hard-clipping. Because normalization runs before Fade in and Fade out, edge fades always terminate cleanly at zero crossings.
Audio cutter modes, fade ramps, and loudness targets
Reviewing the five core controls clarifies how cut modes, edge ramps, and normalization interact before clicking Apply cut & fades. Exported PCM timelines follow the archival structure summarized in the Library of Congress Broadcast WAVE specification so external DAWs read clip lengths accurately.
| Control | Options or range | Default setting | DSP stage in worker | Best use case |
|---|---|---|---|---|
| Keep selection / Cut middle | Two mode buttons | Keep selection | Extracts span or splices outer audio (15 ms crossfade) |
Trim intros vs remove mid-track coughs |
| Start (ms) & End (ms) | 0 to track length (20 ms step) |
5% to 75% |
Maps millisecond markers to integer sample indices | Isolating loops, stingers, or spoken answers |
| Fade in | 0 ms to 2,000 ms (20 ms step) |
80 ms |
Multiplies leading samples by sin^2 ramp after gain |
Eliminates abrupt start clicks |
| Fade out | 0 ms to 2,000 ms (20 ms step) |
120 ms |
Multiplies trailing samples by sin^2 ramp after gain |
Creates smooth music or voice endings |
| Normalize volume | None / -1 dB Peak / -16 dBFS RMS |
Peak normalize (-1 dB) | Applies gain + soft limiter prior to edge fades | Matching levels across exported clips |
Live metadata above the waveform displays original length, trimmed duration, and Peak dB change before and after processing. If an exported narration clip also needs faster playback pacing or musical transposition, run the trimmed WAV through tempo and semitone adjustment right afterward.
Tip: Leaving Fade in at
40 ms–80 msand Fade out around100 ms–160 mseliminates click artifacts even when slicing continuous background music loops where exact zero-crossings are hard to spot visually.
Exporting trimmed WAV, M4A, and WebM clips locally
Once the HTML5 preview player sounds right, the export footer reports exact WAV byte size and appends -trimmed to your original filename. Zero temporary audio chunks touch remote servers during decoding, splicing, or final file generation.
Encoding 16-bit PCM WAV alongside AAC and Opus streams
Clicking Download .wav outputs uncompressed 16-bit stereo or mono RIFF WAV audio directly from worker memory. Where your browser supports the W3C WebCodecs specification AudioEncoder API, Download .m4a (128 kbps AAC) and Download .webm (128 kbps Opus at 48,000 Hz) buttons appear automatically.
Uncompressed WAV keeps zero-generation-loss quality when handing stems off to video editors or podcast hosts. Choosing WebCodecs M4A or WebM compresses finished clips for fast messaging, mobile ringtones, or lightweight web embeds.
Preparing ringtones, intros, and screen narrations offline
Because both uncompressed WAV and compressed WebCodecs exports stay strictly local, sensitive medical dictations, legal memos, and pre-release soundtracks never cross the network. Shortening spoken tracks before embedding also avoids wasting bandwidth when sharing tutorials.
Teams cutting clean voiceover intros or fixing flubbed narration segments can immediately align trimmed narration with offline screen recordings in the same suite. Every browser object URL cleans up automatically once you unload or reset the tab.