When a recording is created using two different computers, the audio files will always be different lengths. Why are they different lengths? …how big can the difference get?
The symptom: Different lengths
The following screenshot has two tracks. The tracks are simply two WAV files, imported, and they both are aligned to begin at exactly zero seconds. I didn’t clip or cut these; they are simply different lengths.
There’re no waveforms visible because these tracks are both completely silent at their end. The view of the wave forms is zoomed in to show about two seconds of time across the width.
The upper track is 22 minutes, ~32 seconds long. (It ends halfway between 31.8 and 32.2 seconds.)
The lower track is 22 minutes, ~32.6 seconds long. (It ends just a smidge beyond 32.6 seconds.)
What does it mean to have different lengths
This turns out to be a real problem. If you were to simply listen to these tracks simultaneously, we start out at zero seconds having a “Hello”, “hi” conversation with nice back and forth, perfectly in time.
But by the end of our conversation (22+ minutes later) the lower track is lagging behind. If this were a recording of us, clapping excitedly at a concert… after 22 minutes, one of us is on the beat, and one of us is on the back beat clapping more than a half second later.
How did we get this far off after just 20 minutes of recording?
How digital audio works
These are WAV files. What’s in a WAV file? It’s little more than a long string of numbers. Some device notes “how loud does the microphone say it is now?” as a number. It does that very quickly, but it’s simply a string of numbers, “how loud?” and “how loud now?” over and over and over…
How many numbers? You may have seen “sample rate” mentioned around podcasting. Sometimes you see “44k” or “48k” as suggested, or possible, sample rates. That’s the number of samples EVERY SECOND.
A one-second-long WAV file would have 44,000 of those “how loud?” samples. Exactly how many isn’t so important. What is important is that it is a certain number of samples per second. (Okay fine, but exactly how many samples?)
44k is very slow for a computer. Computer CPUs (desktop, notebook, phone, dedicated recorders — are all simply computers) do things millions (megahertz) or B_illions (gigahertz) of times per second.
A program tells the computer, I need to do something every 1/44000 of a second. (Or whatever the exact fraction is for the sample rate). The program then samples the volume reported by the microphone. And that’s one more number added to the WAV file.
How computers keep time
Computers know their nominal [what it is supposed to be] CPU speed. They can simply compute how many of those CPU cycles do I count to, before I advance the clock? Time is kept at the microsecond level. (That’s 1/100,000 of a second.) A computer’s “clock” ticks ahead 100,000 times every a second. The computer simply counts oscillations of it’s internal clock… 1, 2, 3, … up to the right [large!] number, and then bumps the clock ahead 1 microsecond.
Just think: counting counting counting TICK (the clock advances one microsecond) counting counting counting TICK … TICK … TICK When the clock advances 1/44,000 of a second the program checks how loud the microphone is and adds a number to our WAV file.
Now use two computers…
You and a friend are in separate rooms. The doors to the hallway are open. You hear a third person counting time. 1. 2. 3. 4. 1. 2. 3. 4. “you guys ready?” “you have the beat?” “you’re really good at keeping time?” …and the doors are closed. How long do you think you’re time keeping is in synch?
Time synchronization among computers—all computers—is the single most important thing which keeps our entire global civilization working. I’m not exaggerating.
Now let’s run two recording programs.
Let’s say we’re using Zencastr, Riverside, whatever. So that means my Chrome web browser on my computer, and my guest’s Chrome web browser on their computer. Those are two programs, on two different computers.
We press record and the two programs start recording. One computer is tick tick ticking at it’s rate, and the program is writing numbers to that WAV file. The other computer is tick tick ticking at it’s rate, and the program is writing numbers to the second WAV file.
And when we stop, we see the difference in our computers time-keeping abilities. One computer recorded more “how loud?” samples than the other. Computer geeks would say: One clock was running faster than the other.
The problem is not with our programs. The problem is with our clocks!
Fun fact: Keeping accurate time on old-timey sailing ships was insanely hard. Check out the book Longitude by Dava Sobel.
How would you fix this?
Now the fun part.
How do I fix my progressively farther out of sync tracks?
How do I fix the actual problem [with the clocks]?