[ID3 Dev] Determining an offset

Morton, Christopher CMorton at caiso.com
Thu Feb 16 11:13:53 PST 2006


Hello,

Please consider the following code (the language doesn't matter) for a
routine that dumps ID3v2 tag data into Excel. As you do, note the binary
offset numbers. My question is, what might be the offset number where
the "album art" flag (1/0) is located? That's a pressing matter for this
exercise (and that's what it is)-to determine if a given MP3 has 1) been
tagged and 2) if the metadata includes (YES/NO) the album JPG. Thanks.

> Chris Morton

;;START CODE
;; BinaryPeekStr extracts a string from a binary buffer (handle, offset,
maxsize)
;; BinaryPeek returns the 8-bit value of a byte from a binary buffer

bb = BinaryAlloc(150)
ThisFile = ItemExtract(FileIndex, List, @TAB)
size = FileSize(ThisFile)
BinaryReadEx(bb, 0, ThisFile, size - 128, 128)
id3 = BinaryPeekStr(bb, 0, 3)
If id3 == "TAG" 

song_title = StrTrim(BinaryPeekStr(bb, 3, 30))
DDEPoke(channel1, "R%row%C2", song_title)
      
artist_name = StrTrim(BinaryPeekStr(bb, 33, 30))
DDEPoke(channel1, "R%row%C3", artist_name)
   	
 album_name = StrTrim(BinaryPeekStr(bb, 63, 30))
DDEPoke(channel1, "R%row%C4", album_name)

album_label = "Not Present"
DDEPoke(channel1, "R%row%C5", album_label)

album_pub_date = StrTrim(BinaryPeekStr(bb, 93, 4))
DDEPoke(channel1, "R%row%C6", album_pub_date)
      
 album_type_desc = "Not Present"
 DDEPoke(channel1, "R%row%C7", album_type_desc)

genre = StrTrim(BinaryPeek(bb, 127))
DDEPoke(channel1, "R%row%C8", genre)

EndIf


---------------------------------------------------------------------
To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
For additional commands, e-mail: id3v2-help at id3.org



More information about the ID3v2 mailing list