Trimming Audio with Clean Fades

After reading this you will be able to cut a precise section out of an audio file, add fade-in and fade-out curves that avoid clicks, and choose between lossless WAV and compressed MP3 export with a clear idea of what each costs you.

What an audio trimmer does

An audio trimmer keeps one contiguous slice of a recording and discards the rest. You pick a start time and an end time, and the tool copies the samples between them into a new file. Nothing is re-recorded and nothing is stretched. The trimmed file is a byte-for-byte copy of the original samples in that window, unless you add fades or re-encode to a lossy format.

Here is the hook. You recorded a 3-minute voice memo but the useful part runs from 12.0 seconds to 47.5 seconds. Trim to that range and you get a 35.5-second clip. Add a 0.5-second fade-in and a 1.0-second fade-out and the clip starts and ends on silence instead of jumping straight to full volume. That jump is what produces the audible click you have probably heard at the edge of a badly cut sample.

When to trim, and when not to

Trimming is the right tool when the audio you want is already correct in level and content, and you only need less of it. Cutting a ringtone from a song, removing dead air at the head of a podcast, or isolating a single spoken sentence are all trim jobs.

Trimming is the wrong tool for three common tasks. If the whole file is too quiet or too loud, you want the Volume Normalizer, not a cut. If the audio lives inside a video, use the Video Trimmer & Compressor so audio and picture stay aligned. And if you need to remove a section from the middle and join the two ends, that is two trims plus a splice, which a single-range trimmer does not do in one pass.

The fade math

A fade multiplies each sample by a gain that changes over time. Silence at the boundary means gain 0; full volume means gain 1. The simplest fade is linear: the gain rises in a straight line from 0 to 1 over the fade duration.

g(t) = \frac{t}{t_f}, \quad 0 \le t \le t_f

Here g(t) is the gain applied at time t seconds into the fade, and t_f is the fade length in seconds. At t = 0 the gain is 0. At t = t_f it is 1. A fade-out is the same idea reversed: gain falls from 1 to 0.

Linear fades are fine for short edges, but the human ear hears loudness closer to the logarithm of amplitude, so a linear ramp can sound like it fades fast then lingers. An equal-power curve fixes this by shaping the gain so perceived loudness changes evenly:

g(t) = \sin\!\left(\frac{\pi}{2} \cdot \frac{t}{t_f}\right)

At the midpoint t = t_f/2, the linear curve gives gain 0.5 while the equal-power curve gives \sin(\pi/4) \approx 0.707. That higher midpoint is why an equal-power fade sounds smoother across a crossfade or a music tail.

Gain 0.707 is exactly 1/\sqrt{2}, which is 3 dB below full scale. Two equal-power fades crossing at that point sum to constant power, so the perceived loudness stays flat through the transition.

Worked example: reproducing the demo

A 35.5-second clip with fades

The demo trims from 12.0 s to 47.5 s with a 0.5 s fade-in and a 1.0 s fade-out, on a file sampled at 44,100 Hz.

  1. Clip length is 47.5 - 12.0 = 35.5 seconds.
  2. Sample count is 35.5 \times 44100 = 1{,}565{,}550 samples per channel.
  3. The fade-in covers the first 0.5 \times 44100 = 22{,}050 samples. Sample 0 gets gain 0; sample 22,050 gets gain 1.
  4. The fade-out covers the last 1.0 \times 44100 = 44{,}100 samples, ramping gain from 1 down to 0.
  5. The 1{,}565{,}550 - 22{,}050 - 44{,}100 = 1{,}499{,}400 samples in the middle keep gain 1 and pass through unchanged.

With a linear fade-in, the sample at 0.25 s into the clip (sample 11,025, the halfway point of the fade) is multiplied by 0.5. With an equal-power fade-in it is multiplied by 0.707. Same input sample, two different output values, one choice of curve.

Gain rises from 0 to 1 over the first 0.5 s, holds at 1 through the body, then falls to 0 over the final 1.0 s. Shaded regions are the two fades.

Comparing fade curves

The difference between curve types is small in duration but audible at the edges. The table shows gain at the same three points inside a 1.0-second fade-in for the two curves.

Gain at three points inside a 1.0 s fade-in
Time into fade (s)Linear gainEqual-power gainDifference
0.250.25000.38270.1327
0.500.50000.70710.2071
0.750.75000.92390.1739

The equal-power curve is always at or above the linear curve inside the fade, peaking in difference near the middle. That extra energy is what keeps a music fade from sounding like it drops out too early.

A linear fade of length 1.0 s reaches gain 0.5 at its midpoint; an equal-power fade of the same length reaches 0.707 at its midpoint. Longer fades stretch the same curve shape over more time without changing the midpoint gain.

Reading the waveform to place cuts

The waveform shows amplitude over time. Loud passages are tall; silence is a flat line near zero. Use it to place cut points on silence rather than mid-word or mid-note. A cut on a zero crossing (a point where the waveform passes through zero) produces no step in amplitude, so no click, even without a fade.

Fades exist precisely because you often cannot land on silence. If the clip must start in the middle of a sustained note at amplitude 0.8, a 10-millisecond fade-in brings that to zero at the boundary. At 44,100 Hz, 10 ms is 441 samples, short enough to be inaudible as a fade but long enough to remove the click.

If you hear a faint tick at a cut edge and you did not add a fade, add a fade of just 5 to 20 ms. That is almost always enough to kill an edge click without changing how the clip sounds.

Common mistakes

Fades longer than the clip. If you set a 2-second fade-in and a 2-second fade-out on a 3-second clip, the two ramps overlap in the middle and the clip never reaches full volume. Keep the sum of fade lengths below the clip length, with margin.

Re-encoding lossless source to MP3 by habit. MP3 is lossy. Every encode discards audio data the model judges inaudible. If your source is WAV and you export MP3, you lose quality you cannot recover. Export WAV when you have the disk space and plan to edit further.

Trimming to fix level. A quiet clip stays quiet after trimming. Fades scale amplitude down at the edges but never raise the body above the source level. Normalize first if the whole clip is too soft.

Expecting sample-exact boundaries at arbitrary times. A cut at 12.3456 s is rounded to the nearest sample. At 44,100 Hz one sample is about 0.0000227 s, so the rounding error is at most half that, around 11 microseconds. Inaudible, but worth knowing if you compare byte offsets.

Related tools

Trimming is one step in a short chain. To set the loudness of the result to a target peak or integrated level, use the Volume Normalizer. If the audio you care about is the soundtrack of a video and the frames must stay in sync, trim the whole file with the Video Trimmer & Compressor instead of extracting the audio first.

Frequently asked questions

Does trimming reduce audio quality?

Not by itself. A WAV export copies the original samples exactly, so the trimmed region is identical to the source. Quality loss only happens if you export to MP3, which re-encodes with a lossy codec.

Why is my MP3 export slower than WAV?

WAV writes the raw samples straight to a file, which is instant. MP3 has to run an encoder, and the encoder (an ffmpeg build) downloads on first use before it can run. After that first download it is cached.

What fade length should I use?

For removing edge clicks, 5 to 20 ms is enough. For a musical fade-out that the listener notices, use 1 to 3 seconds. For a spoken clip that should start on silence, 100 to 300 ms feels natural.

Are my files uploaded anywhere?

No. Decoding, cutting and encoding all run in your browser through the Web Audio API. The audio never leaves your machine.

Can I trim a section out of the middle?

Not in one pass. This tool keeps a single contiguous range. To drop a middle section you would trim the two outer parts separately and join them in an editor.