Syncing Looped Samples

Audacity v.2.0.3
Windows 7 x64

I’m attempting to loop several samples together to mix a song. The original track I used was in 114 BPM, and I added two other tracks with samples I used Change Tempo in a separate window to get to 114 BPM. When looping them, the tracks were initially lined up, but there seems to be very slight differences in the length of each sample, causing them to fall out of sync. I ensured the pasted piece of loop from each track was the same size, and there are no further edits done to the speed or length of the tracks.

Is there something I may be doing wrong that is causing them to desync?

You were right when you wrote “but there seems to be very slight differences in the length”.

To ensure that the lengths are exactly the same:

  1. ensure that all audio tracks have the same “sample rate”.
    The sample rate is shown in the info panel on the left end of the track (http://manual.audacityteam.org/o/man/audio_tracks.html#info)
    The default sample rate is 44100 Hz.
    If tracks have different sample rates, use “Tracks menu > Resample” to convert the tracks to the same sample rate.

  2. Set the time format in the Selection Toolbar to either “samples” or “hh:mm:ss+smaples” (http://manual.audacityteam.org/o/man/selection_toolbar.html).
    You will then be able to check that your loops are the right length to nearest “sample”. “Samples” are the “dots” that you see if you zoom in (http://manual.audacityteam.org/o/man/zooming.html) really close on a waveform. “Samples” are the smallest unit of time for digital audio, so if two audio clips are the same length to the nearest sample, then they are exactly the same length.

The length of “one sample period” depends on the “sample rate”. For the default sample rate of 44100 Hz, the duration of one sample period is 1/44100th second (0.000022676 seconds) and all lengths at that sample rate are an exact multiple of that length.

Well thank you very much! I didn’t give a second thought to sample rates. I know off the top of my head that all three are different sample rates. I will correct this immediately!

To maintain the sound quality, don’t resample to below 44100.
44100 Hz is a very standard rate for audio (48000 is standard for DVD). Because I’m usually working with audio only (not video) I generally set everything to 44100 Hz, which ensures that I don’t run into any compatibility or sample rate mis-match issues further down the line.