I thought you said "Earn more sessions by sleeving."

I was at a sandwich shop the other day, doing the obvious thing. The middle-aged asian woman behind the counter took my order, started making the sandwich, and then halfway through stopped and asked me in a very thick accent, "Excuse me, do you know who is ______?"

    "Who?"
    "________."
    "Um..."
    "________."
    "I'm sorry, I don't understand...."
    "Do you know who is Ghengi Khan?"

Wait. Did she really just say Ghengis Khan? I steal a glance at my t-shirt: am I obliviously wearing a picture of a rapacious Mongol? No, no I'm not. I ask, "Um.... you mean the Mongolian conqueror?" Even as I say it, I really can't believe that's right. Or maybe she's talking about a band or something.

"Yes, yes!"

"Yup, I've... heard of him..." I'm really confused now.

She says, "those guys didn't know him," pointing at a pair of older asian fellows sitting at a table having lunch who seem to be totally ignoring us.

I nod knowingly. I'm dying to know how this came up, but I'd already waited too long to eat, and my world had gone all surreal even before Ghengis came into it, so I just let it go.

Tags:

more winnage from CDDB

In case you didn't know, the file format that CDDB (and FreeDB) use is complete garbage. In addition to random idiotic crap like it being impossible to unambiguously represent a song title that has a slash in it, it's rocket science to figure out how long a song is supposed to be. I need this info not only to display it in Gronk, but also for some error-checking that my ripping scripts do, so that I don't end up with truncated files if there was a crash or a full disk or something.

So get this. CDDB files contain junk like this:

    # Track frame offsets:
    #       150
    #       18265
    #       32945
    #       49812
    ...
    # Disc length: 3603 seconds
(You'd think that the fact that it's in a comment would mean something, but no: you have to parse both comments and non-comments, begging the question of what they thought "comment" means.)

Those numbers are the starting sectors of each track on the disc. There are 75 sectors per second. So you convert those to seconds by dividing, and then find the length of each track by subtracting each from the previous. Oh, but wait, they don't give you the sector address of the end of the last track: for that one, it's expressed in seconds, for no sensible reason. Still, the info is there, right?

Uh, almost.

It turns out that if the last track on a CD is a data track (an ISO9660 file system) then there is a gap between the last track (the data track) and the second-to-last track (the last audio track.) This gap is exactly 11400 sectors (152 seconds, 2:32.) On some discs, you can actually see this track, it's a differently-shiny ring. Why's it there? I don't know. Why's it that size? I don't know. What if the data track is not the last track on the CD? (Does that even work?) I don't know.

So what this means is, when computing the length that a track should be, you have to subtract 152 seconds from the length of the second-to-last track, only if the last track is a data track.

How do you tell whether the last track is a data track? By hoping that the CDDB file contains the words "data track" in the title of that track, I guess. Yeah, that's reliable.

And, just to keep things interesting, it turns out that older versions of grip and cdparanoia didn't skip over this gap when ripping: instead, they would append 152 seconds of silence onto the end of the second-to-last track. So now my script that sanity-checks the lengths of the files has to consider two different lengths to be "right", since I now have CDs that were ripped both ways.

Whee. Love love love supporting standards invented by 12-year-olds.

Of course the reason that I use CDDB files at all in Gronk is because of the mind-blowing worthlessness of ID3 tags (32 character limits on titles, etc.) Yay more standards invented by 12-year-olds. (Please don't even mention ID3v2 or Ogg. I laugh at you, you silly person.)

Tags: , ,