Song length detection in vbr mp3s

Viewing 4 posts - 11 through 14 (of 14 total)
  • Author
    Posts
  • #9528
    CCRDude
    Participant

    Lame 3.96 does this as well? In this case I can probably find it myself, let me take a look… yes, I found it!

    Btw, here is a description of the Xing header I just found and used for implementing:
    http://www.codeproject.com/audio/MPEGAudioInfo.asp

    Something interesting: the files I ripped using CDex show a different default TLEN than this field! (only a few milliseconds, but still)…

    Well, code has already been implemented roughly, just need to give it a short test with a few more files.

    #9529
    rpedde
    Participant

    @CCRDude wrote:

    Lame 3.96 does this as well? In this case I can probably find it myself, let me take a look… yes, I found it!

    Btw, here is a description of the Xing header I just found and used for implementing:
    http://www.codeproject.com/audio/MPEGAudioInfo.asp

    Something interesting: the files I ripped using CDex show a different default TLEN than this field! (only a few milliseconds, but still)…

    Well, code has already been implemented roughly, just need to give it a short test with a few more files.

    That’s the page I used as a reference too. Currently to determine song duration I use TLEN first, then Xing (if present), then frame counts (if mode 1 or 2), and if all else fails, data length and bitrate.

    #9530
    CCRDude
    Participant

    A quick command line solution for now (I’m out of the house for most of the week, so I don’t have time for more right now), which parses all specified mp3 files in a folder, and adds or updates TLEN fields in existing ID3v2 tags.

    Usage:
    trMP3Length *.mp3 /recursive /debugWould show actions that would be done on all mp3 files in the current folder and subfolders. Add /udpate to not only add TLEN where its missing, but also correct TLEN where it’s different from the Xing field. And if everything looks ok, use /write as well to actually have it write the changes, so once you’ve verified everything is correct, use:
    trMP3Length *.mp3 /recursive /debug /update /write

    Disclaimer: Trying this on a copy of a single folder first is recommended, just to make sure it doesn’t conflict with your style of tags. It won’t do anything if it doesn’t recognize the tag (e.g. it won’t deal with ID3v2.2, only with ID3v2.3 and ID3v2.4) and understands even unsynchronizing and unknown fields, but who knows, the ID3v2 standard has been interpreted in a lot of different ways by some.

    Oh, and since Ron mentioned the nightlies already know even more methods to determine it, just regard this as “tag beautification”, not as something important, if you’re using a nightly 😉

    If I find the time, I’ll probably see if I could implement the other ways as well if Xing tags are not present (like I just saw with iTunes-generated MP3 files), as well as VBRI frames.

    #9531
    rpedde
    Participant

    @CCRDude wrote:

    Click for trMP3Length.zip (Windows only currently, didn’t find the time to port to FreePascal/Linux yet)

    Beauty. Nicely done, sir.

    — Ron

Viewing 4 posts - 11 through 14 (of 14 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.