Forum > Audio and Video

MP3 id3 tag v2

<< < (2/4) > >>

Awkward:
if you don't want to search and use old (since D3 i think) Audo Tools Library (if i remember right), you can check https://www.3delite.hu/Object Pascal Developer Resources/id3v2library.html
Tags Library there have sources and examples dor other tag formats too

lucamar:

--- Quote from: Fred vS on May 19, 2020, 07:56:44 pm ---@lucanar, afaik, a mp3 that has v2 (tag info at begin of file) has also v1 (tag info at end).
--- End quote ---

Not necessarily, though it's rather common. The real question, though, is that the OP asked specifically for ID3v2 tags. :)

Fred vS:
> The real question, though, is that the OP asked specifically for ID3v2 tags

Ok, ok, so it is exactly the same principle, but from begin of file.

If you read the first 3 bytes, and they are equal to "ID3", then skip to the 7th byte, then read the header size.

winni:
Hi!

That's the way to get ID3 Tags version 1:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---TYPETAG_ID3 = record   // 128 byte    id: Array[0..2] of AnsiChar;    title: Array[0..29] of AnsiChar;    artist: Array[0..29] of AnsiChar;    album: Array[0..29] of AnsiChar;    year: Array[0..3] of AnsiChar;    comment: Array[0..29] of AnsiChar;    genre: Byte;  end;  Function ReadTagID3Tag (fname : String; var Tag: TAG_ID3 ): boolean;var phyle : File of byte;      ok : Boolean; beginfillchar(tag,sizeof(tag),0);ok := false;if LazFileUtils.FileExistsUTF8(fname) then  begin  {$I-}  assign (phyle,Fname);  reset (phyle);  seek(phyle, fileSize(phyle) -sizeof(tag));  blockread(phyle,tag,sizeof(tag));  closeFile (phyle);  {$I+}  ok := tag.id = 'TAG';result := ok;end; ......var artist : string;.....artist := string(tag.artist);..  
The genre byte points to al list of around 200 genre strings.
I add an include file with the genres in the attachment.


Winni

PS.: Had to rename it to '*txt' to get through the "sophisticated" forum filter

Fred vS:
> That's the way

Yes (and I dont see any difference with my previous code).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version