How to Compare Two Recordings That Start at Different Times
You export the same song twice, or record the same screen twice, and one copy has a little more silence at the start. Played side by side they are obviously the same. Compared sample against sample, they are not: every moment of one is being measured against a slightly different moment of the other.
This is one of the most common reasons a comparison reports a low score on files that are, in every way that matters, identical.
How much a small offset costs
More than you would expect. In our own tests, the same audio recording delayed by 0.3 seconds scored 50% before automatic alignment was added — while every per-second bar on the chart still read close to 100%. Measures that compare the files moment by moment (how bright the sound is, how loud it is) collapsed, because they were lining up a note in one file against the silence before it in the other.
Video behaves the same way. A frame compared against the frame a quarter of a second earlier looks like motion everywhere.
Where offsets come from
- Encoder padding. MP3 and AAC encoders add a short stretch of silence at the start; different encoders add different amounts.
- Exports with handles. Editing software often exports from slightly before the first clip.
- Two separate recordings. Two people pressing record on the same stream will never press it at the same instant.
- Streams. A recording of a live stream starts wherever the recorder joined.
How automatic alignment works
The idea is to find the shift at which the two files agree best, and only use it when the answer is clear.
For audio, DiffALL compares the two files’ loudness envelopes — how loud each one is, every 10 milliseconds — at every shift within two seconds either way, and picks the shift where they line up best. It only applies the shift when that best match is decisive. A pair that matches about as well at every shift is left alone, because an alignment it is not sure about would be a guess presented as a fact.
For video, it compares small fingerprints of the first few seconds of each file, frame by frame, and does the same thing.
When it shifts the files, the result says so, above the score:
Lined up automatically. The Actual file starts 0.30s later, so both were compared from the point where they match.
That sentence matters. Without it a 0.3-second head start is silently absorbed, and you cannot tell why two files that start differently scored the same.
Where it stops
- Two seconds. Alignment searches within two seconds either way. A file that starts ten seconds later — a recording that includes a long intro the other does not — needs trimming first.
- Speed changes. A copy played 5% faster drifts further out of step the longer it runs. No single shift fixes that, and the comparison correctly reports a large difference.
- A piece from the middle. If one file is a short excerpt of the other, taken from further in, there is no small shift that lines them up. The result says when two files are very different lengths and the score is low, and the fix is to trim the longer one to the same part — or to choose the start point, see how to compare only part of a long recording.
Sample-accurate alignment
The automatic alignment works at the scale of milliseconds, which is plenty for a score. For a null test — subtracting one file from the other to hear the difference — it has to be exact to the sample, and that is done separately when you ask for the difference track. See how to null test two audio files.
Stop hunting for differences by hand. DiffALL spots every change between any two files — automatically.
Compare your files — free