Zazama / node-id3

Pure JavaScript ID3 Tag library
MIT License
285 stars 57 forks source link

length/TLEN #114

Closed ai-compatible closed 2 years ago

ai-compatible commented 2 years ago

The documentation indicates length/TLEN support but I do not see a value coming back for it.

If I ask for all the tags from an mp3 file (no options), I see TALB, TPE1, COMM, TCON, TIT2, TRCK, TYER and APIC... just not TLEN. I was suspicious of the MP3 file, but MP3TAG and Windows properties tell me the value is present in several files I've tested.

Any ideas of what I might be doing wrong? Thanks in advance.

Zazama commented 2 years ago

Hey, can you provide me an mp3 file that works in Mp3tag but not in node-id3 via mail to jan.metzger@gmx.net?

Zazama commented 2 years ago

If someone has the same problem:

What you can see in MP3Tag and other tools is the length that they read from the MP3 audio data itself. Basically, in every mp3 file, you can prepend an ID3 tag with information about it to the audio data, but both of them are completely seperate things. NodeID3 reads information in the ID3 tag, which most of the time has no length stored in it. Tools like MP3Tag etc. can also read the audio data and calculate the length from that, which is what you see there.

If you need a node library for reading/calculating audio duration, I can recommend you music-metadata (https://github.com/borewit/music-metadata). It can also read ID3 data at the same time if you don't need write support.