Really gapless
2007-02-28 17:29:34
In this page of the HA knowledge base...http://wiki.hydrogenaudio.org/index.php?title=Gapless It says this...Testing for gapless The best way is by using Test Samples listed at the end of this page. Some people attempts to detect gapless by generating pure tones, and encoding them into a lossy format. This is not recommended for two reasons: 1. Unless the first tone ends at 0 level and the second tone starts at 0 level, a glitch will be heard during transition. Surely, exactly the same applies to real tracks from real CDs? Unless they fade to silence (in which case, who really cares about gapless?!) the sample values could be anything. It seems to me (and someone please explain why I'm wrong) that the enthusiastically embraced encoder/decoder offset/gap correction found in lame and foobar2k closes the gaps, but doesn't deal with the glitches that inevitably ocurr when you make lossy encodes which start or end abruptly. In other words, the pure tone example is a perfectly good way of testing for gapless and glitchless encoding+playback, but the reason the wiki author dislikes it is because it shows up the limitations of the modern lame/foobar2k gapless playback algorithm. Meanwhile the "depreciated" --nogap switch, when it worked, handled this situation perfectly, albeit by moving the track boundary back slightly. Sadly, this method isn't supported within foobar (but clearly works just be concatenating the files together!), and Gabriel has suggested it should be removed from lame. If you want to check for yourself, grab glob from here:http://www.rockbox.org/twiki/bin/view/Main/GaplessHowTo (end of the page) and then create a tone, chop it up, number the bits (I've attached a .zip on my own effort), and then do the following...glob -c lame -V 6 --vbr-new -m m --nogap "C:\audio\test 2\*.wav" copy "C:\audio\test 2\* tone.mp3" /B "C:\audio\all tone.mp3" /B Listen to all tone.mp3. Then, as an alternative, try encoding the bits separately, and playing them back2back in foobar2k. For me, the first one is really glitchless and gapless, while the second one has easily audible glitches in it. I've attached the tone files I'm using. You can of course play them back2back without glitches as .wavs to prove that they're correct. What am I doing wrong? Why has no one raised this before? Cheers, David.