couldn't get any sleep, so here you go.
Firstly, this method only works for those CDs which have been ripped using an accurate ripper, and compressed with the same encoder.
Before you start.
You will need:
Foobar
Case's Gap Killer
In your DSP list, put the Gap Killer at the top of your DSPs, and load your playlist with the mp3's you want to make gapless.
Play your CD, and skip to near the end of each track. Listen to the transition, and if it isn't smooth - i.e. sounds jumpy or there are samples missing, then your underlying mp3's aren't accurate and this method can't help you.
If your mp3s are smooth (with Case's Gap Killer) you can continue.
Fixing the encoder delay.
Show the foobar Console. (components/show console.)
Play the first track and move the slider almost to the end, so that it flips to the next track. In the console you'll see how many samples the gap killer removed as below:
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\201.mp3" (0)
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\202.mp3" (0)
INFO (foo_dsp_nogaps) : 887 samples removed (from end)
INFO (foo_dsp_nogaps) : 576 samples removed (from beginning)
This shows us that it removed 887 samples from the end of track 1, and 576 from the beginning of track 2. At the moment, we're only concerned with the samples removed from the beginning. Quickly skip to the end of all your tracks (in order) and make a quick table as below.
Track samples removed
from beginning
1 576
2 576
3 578
4 576
5 575
6 578
7 254
8 577
9 577
10 576
11 576
12 578 (end of cd)
From this list, we can deduce that the most likely number of samples to remove from the beginning of each track is 576 - i.e. the encoder delay for each track is 576 samples.
Note, in my example above, track 7 hasn't got the correct encoder delay, and when playing this track there is a audible skip with missing samples (with gap killer). This track transition can't be fixed.
This is probably a LAME encoded album, but since foobar didn't detect the mp3 as being of accurate length, we're going to have to fix the mp3 headers. This method also works for Fhg and Xing encoded mp3s, as long as the delays are all close to each other.
Right click on each file in turn, and choose Fix MP3 header... Enter the same encoder delay for each one, and leave the desired length BLANK.
You've now fixed the encoder delay for all your mp3s.
Play the first track again, and move the slider near the end - check the console, you should now see entries like this:
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\201.mp3" (0)
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\202.mp3" (0)
INFO (foo_dsp_nogaps) : 887 samples removed (from end)
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\203.mp3" (0)
INFO (foo_dsp_nogaps) : 1200 samples removed (from end)
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\204.mp3" (0)
INFO (foo_dsp_nogaps) : 1078 samples removed (from end)
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://D:\_mp3\VA\Gatecrasher Resident Transmission 02 CD1\205.mp3" (0)
INFO (foo_dsp_nogaps) : 1078 samples removed (from end)
Note that Gap Killer is no longer removing samples from the beginning of the tracks.
Fixing the track length in samples.
Now you'll need my spreadsheet. Start the spreadsheet next to Foobar, so you can see both of them at the same time. The only value you're going to enter is the original length in BLUE.
Play the first track (showing the console), and flip to the next track - your output should say as follows:
INFO (foo_dsp_nogaps) : 887 samples removed (from end)
Right click the first track (you don't need to stop foobar, since it's now playing the second track), and choose Fix MP3 Header... Copy the length in samples from the dialog box, and paste into the spreadsheet. You can ALT-TAB between Excel and Foobar, leaving the cursors in the same place.
In the spreadsheet, you're looking for the track length in samples (RED values), which is closest to the output of Gap Killer. Gap Killer removed 887 samples, and the corresponding track length is 13732152 (in my example). ALT-TAB back to foobar, and edit the desired length. Hint, usually only the last four digits change.
Press OK to save your new length, and double click the first track again. Skip to the end, and your mp3s should now be gapless!
Repeat this for the rest of your mp3s, and your work is done!
You can now remove Gap Killer from the active DSPs and check your work.
Troubleshooting
If this doesn't work for you, your mp3s probably don't sound right with gap killer anyway, therefore you're not going to able to fix your mp3s. Sorry. Also, if you've got an album collected from various sources, and they don't all have the same encoder delay, you can try setting them individually, but whenever I've done this, I've run into problems.
Tips for Writing CDs with Nero.
Some of my albums only have a few gapless tracks between some songs - don't waste your time fixing all of the tracks, only do those that are needed.
My reason for doing this, was so that I could write gapless CDs for the Car. If you're doing the same, and you're using Nero, I suggest you do the following.
When you're outputting your mp3s to WAVs using the Diskwriter, use the output file name formatting as %artist% - %title%.
To create an Audio CD in Nero, sort your directory by date/time, and drag your WAVs into the compilation. Your Artist and Track Title fields will be properly formatted for CD-TEXT. You just need to highlight tracks 2-end, double click and set track gap to 0.
Press Burn, set the Artist, Album Name, Speed and Go.
ps. where can I upload the spreadsheet?