Menu

Search toolsChangelog

to move to openDescribe the problem, not the tool

Cut a WAV Without Losing Quality

Yes. Choose the start and end times, then download a new WAV whose retained sample frames are copied byte for byte from the original. Because the audio is never decoded or re-encoded, its sample rate, bit depth, channels and sample values do not change.

PCM or IEEE-float WAV, including RF64 and WAVE_FORMAT_EXTENSIBLE. The file stays in this tab.

The first sample frame to keep, in seconds from the start of the recording.

The point to stop. A time beyond the file's length is safely clamped to its final frame.

Trimmed length (seconds)
The exact number of retained sample frames divided by the sample rate.
Original length (seconds)
First sample frame
Sample frames kept
Output size (bytes)
What to take away
  1. The cut is lossless because complete sample frames are copied rather than passed through an audio codec.

  2. The new file keeps the original format block but deliberately leaves behind tags, markers and other metadata.

  3. A requested time is rounded to the nearest sample frame, usually a difference of far less than one millisecond.

How it works

How it is done

  1. Check that the first twelve bytes identify a little-endian RIFF or RF64 WAVE file. A big-endian RIFX file is refused because copying its samples into a little-endian container would change their meaning.
  2. Walk the RIFF chunk list, respecting the pad byte after an odd-length payload, until the fmt and data chunks have both been found. For RF64, read the 64-bit audio length from its ds64 chunk.
  3. Read the channel count, sample rate, block alignment and bit depth from fmt. If the format is WAVE_FORMAT_EXTENSIBLE, unwrap its sub-format GUID to distinguish PCM from IEEE float.
  4. Verify that the format is fixed-width PCM or IEEE float and that the declared block alignment equals channels multiplied by bytes per sample. A compressed or internally inconsistent file is refused rather than cut at a guessed boundary.
  5. Divide the data length by the block alignment to get the exact number of complete sample frames and, from that, the recording length.
  6. Multiply each requested time by the sample rate and round to the nearest whole frame. Clamp an end beyond the recording to its final frame; refuse a start at or beyond the end.
  7. Copy the selected frame range in 4 MB pieces into a fresh WAV. The format block is preserved, a new fact count is written for float audio, and the RIFF and data sizes are recalculated.
  8. Leave metadata chunks out of the result because their cue positions, loop points and time references would describe the untrimmed recording. Offer the new metadata-free WAV as a download.

What it assumes

  • PCM and IEEE-float WAV files are supported, including WAVE_FORMAT_EXTENSIBLE and RF64. Compressed WAV encodings and big-endian RIFX are not, because cutting either safely requires decoding or byte-order conversion.
  • A requested time can fall between sample frames. It is rounded to the nearest complete frame, so the largest timing adjustment is half a frame — about 0.011 milliseconds at 44.1 kHz.
  • An end time beyond the file is clamped to the last complete frame. A start at or beyond that frame leaves no playable audio and is refused rather than producing an empty file.
  • The sample rate, channel count, bit depth, format block and retained sample bytes are copied. There is no gain change, fade, resampling, dither or codec pass.
  • Metadata is deliberately not copied. Broadcast time references, cue points, regions, loops, labels, artwork and comments would otherwise point into the old timeline or disclose details the visitor did not intend to keep.
  • A data chunk must contain a whole number of sample frames and fit inside the file. A partial last frame or a chunk length past the end is treated as truncation rather than silently repaired.
  • The whole input and the trimmed output exist in memory at once. Input is therefore capped at 256 MB, and a bounded RF64 result is written as an ordinary RIFF WAV.

Common questions

Does a lossless WAV cut change the sample rate or bit depth?

No. The output copies the original format block and complete audio frames, so the sample rate, channel count, container bit depth and individual sample values stay the same.

Is a byte-for-byte audio copy also a byte-for-byte file copy?

No. The retained audio payload is identical, but the surrounding WAV container is rebuilt with new size fields and without metadata chunks, so the complete files have different checksums.

Sources

The full method, worked example and every assumption behind this figure are on WAV Audio Trimmer.