Reputation: 725
I'm using TabLib for extraction, but i need to know how many bytes should i download from the mp3 file, in order to be able to extract TagLib.
I've looked into mp3 specs, but i didn't found anything relevant.
Upvotes: 1
Views: 1938
Reputation: 2419
In 99% of cases, if you pull down first the first 10 bytes, you'd then have the ID3v2 header, of which the last 4 bytes will be the size of the ID3v2 tag, which will contain the cover art.
The ID3v2 size is a "sync-safe integer", but TagLib has a function to decode that to a normal integer:
TagLib::ID3v2::SynchData::toUInt(const ByteVector &data)
So, basically the algorithm would be:
Upvotes: 2
Reputation: 409176
The mp3 specification doesn't really have meta-data like song name, or album art. It's part of id3, and it's normally placed at the end of the file.
Upvotes: 1