Help - Search - Members - Calendar
Full Version: Burning gapless...
Hydrogenaudio Forums > CD-R and Audio Hardware > CD Hardware/Software
daPyr0x
Alright, so I'm the scum of the Earth and occasionally download albums in mp3 that are meant to be gapless. As we all know, most mp3 rips aren't encoded with LAME 3.96 or whichever it is that writes those tags to enable gapless and they end up having gaps.

Anyways, I've just finally figured out a good way to get Winamp to play gapless (Without needing a shitty written plugin, or restricting myself to only listen to my own Oggs and FLACs), and it seems, well, legitimately easy for one to put together a CD Burning program with silence detection and elimination of it's own, and the ability to burn what it read gaplessly. I know it's rather easy to burn gapless once your tracks are gapless, but how can I do it with tracks that, well, aren't as much as I might like?
timcupery
here's what you need to do:
1. figure out the offset of the mp3's in a given album. If you're going to burn a disc from mp3's of a live album (or other types of records where gapless is important), then it should be pretty easy to figure out the offset. Convert a couple of the mp3's to a wav file, and see how many samples into the file the actual audio starts. With LAME, it's 576 samples. I got a bootlegged Radiohead concert (where I'd actually been in attendance, three years earlier, so I cared to have it) and the offset was 693 samples or something like that. Different mp3 encoders have different offsets.
2. Use foobar (you'll have to go song-by-song, one at a time) to "fix mp3 header" and write in the correct offset.
3. cd-audio is organized in blocks of 1/75 of a second (588 samples). So any mp3 ripped from a cd should be exactly 588 samples, plus whatever amount of padding (usually between 529 and ~2000 samples) at the end. You could use foobar (which will read the offset and not decode the first 576 or 693 samples) to decode. You'll probably want to decode with dither, since that'll sound better when played in a cd player (may not be perceptible, though). After decoding, use WaveTrim (a freeware program) to crop the files to multiples of 588 samples - this cuts off whatever leftover number of samples beyond 588. (If you use Nero to burn, you don't need to do this, since Nero dumps any leftover samples beyond multiples-of-588; most cd-burners add silence to fill in the end instead).
4. This will get you files with correct offset, except there might be one or two silent frames at the end of the file - 588 or 1176 samples of silence. If you want to fix this, you'll need to go in with a wav-editing program. I especially like Exact Audio Copy's wav editor, since it superimposes lines that mark the sector boundaries of 588 samples.

This is a lot of work. I'll be interested to see if people know easier ways.
shrinkmail
Thanks tim for this wonderful guide.
1. A dumb question though, is 576 samples percievable as a "gap" normally?
2. Why the reference to 693 samples in para 2?

SM
timcupery
QUOTE(shrinkmail @ Sep 16 2005, 03:43 PM)
Thanks tim for this wonderful guide.
1. A dumb question though, is 576 samples percievable as a "gap" normally?
2. Why the reference to 693 samples in para 2?
*

First, 576 samples is perceptible as a gap. If I'm listening closely, I can hear a gap of silence as small as 70 or 80 samples. 576 is clearly noticeable as a blip in applause or bass chord or whatever it is that joins two songs together so we'd want them to be gapless.
Second, different mp3 encoders have different starting offsets. In Lame mp3's, the encoded audio doesn't actually start until 576 samples into the song. This is called offset or pre-gap or things like that. Other encoders will have different offsets. So the 693 (I'm not actually sure of the number) is the offset that I figured out on the mp3's of the bootlegged Radiohead concert.
daPyr0x
So that's to say there's nothing nice and easy like a "trim silence off start/end of tracks" and then "silence is <-__dB" type software eh?
Mike Giacomelli
QUOTE(daPyr0x @ Sep 16 2005, 03:59 PM)
So that's to say there's nothing nice and easy like a "trim silence off start/end of tracks" and then "silence is <-__dB" type software eh?
*



Sure theres tons of it. However it doesn't always work very well.

Also, do you really have a problem with gapless songs? Unless you're using Kazaa, virtually all MP3s floating around the net are gapless.
daPyr0x
QUOTE(Mike Giacomelli @ Sep 16 2005, 03:41 PM)
QUOTE(daPyr0x @ Sep 16 2005, 03:59 PM)
So that's to say there's nothing nice and easy like a "trim silence off start/end of tracks" and then "silence is <-__dB" type software eh?
*



Sure theres tons of it. However it doesn't always work very well.

Also, do you really have a problem with gapless songs? Unless you're using Kazaa, virtually all MP3s floating around the net are gapless.
*



I'm speaking specifically of full albums all downloaded from one source or torrent; and I have yet to find any that will play gapless on the CD; whether it was created with Nero or with EAC. Works wonderfully on the off chance I can find Oggs or FLACs, or when I'm burning copies of my own collection; but not so much with MP3. There is always *some* gap. My Karma can typically get rid of it, which is good on that end; and I now have Winamp getting rid of it, but I can never get totally rid of it on the CD...
skamp
QUOTE(timcupery @ Sep 16 2005, 09:54 PM)
If I'm listening closely, I can hear a gap of silence as small as 70 or 80 samples.
*


Correct me if I'm wrong, but 70 samples is a duration of (70 / 44100) less than 2 ms... I haven't tried, but I'm quite surprised one could spot such a short gap...
daPyr0x
Believe it

There's definitely a blip there. With a gap that small I wouldn't care really, but it's there and noticable nonetheless.
Teej a.k.a T-Dj
Then...if the problem is the fact that they're in MP3 format, couldn't you just turn them into Wav files using foobar with the gap killer on, and then burn?
timcupery
QUOTE(Teej a.k.a T-Dj @ Sep 16 2005, 09:37 PM)
Then...if the problem is the fact that they're in MP3 format, couldn't you just turn them into Wav files using foobar with the gap killer on, and then burn?
*



Once you figure out the correct offset (e.g., 576 samples, or 671 samples which was the exact offset on the Radiohead live bootleg that I downloaded, I just checked now that I'm at home), then foobar will decode starting 671 samples in, so, the start of the song will be correct. But you'll still need to be careful with the end if you want good gapless.
The problem with automatically trimming silence is that the filler samples of the mp3 are not fully silent. They're close, so if you set WaveTrim to trim analog silence below a certain value (e.g., -60 dB, -72 dB), it'll get most of it - but often not all, or often too much. If you want to get accurate-length tracks from random mp3's, for burning gapless stuff onto cd, I don't think that there are any short-cuts from the process that I described above.
boojum
Did I miss something? Just use burnatonce and leave out the two second gap. Or, use foobar2000 doing the same thing. cool.gif
Mike Giacomelli
QUOTE(daPyr0x @ Sep 16 2005, 06:37 PM)
QUOTE(Mike Giacomelli @ Sep 16 2005, 03:41 PM)
QUOTE(daPyr0x @ Sep 16 2005, 03:59 PM)
So that's to say there's nothing nice and easy like a "trim silence off start/end of tracks" and then "silence is <-__dB" type software eh?
*



Sure theres tons of it. However it doesn't always work very well.

Also, do you really have a problem with gapless songs? Unless you're using Kazaa, virtually all MP3s floating around the net are gapless.
*



I'm speaking specifically of full albums all downloaded from one source or torrent; and I have yet to find any that will play gapless on the CD; whether it was created with Nero or with EAC. Works wonderfully on the off chance I can find Oggs or FLACs, or when I'm burning copies of my own collection; but not so much with MP3. There is always *some* gap. My Karma can typically get rid of it, which is good on that end; and I now have Winamp getting rid of it, but I can never get totally rid of it on the CD...
*



Unless they're truely ancient or damaged by something like vbrfix, they should be gapless. Have you tried using a gapless decoder like foobar's to burn them?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.