I did not follow the thread in details, but maybe it is easier for you to apply a ready-made component: there is an ID3v2 component in JVCL. Open Online-Package-Manager, scroll down to JVCLLaz and check the packages jvcorelazr, jvcorelazd, jvmmlazr and jvmmlazd. Click install. When Lazarus has been recompiled the new component can be found on palette "JVCL Non-visual".
Here is a little console demo (a more complex, full GUI demo comes with the JVCL installation):
program Project1;
{$mode objfpc}{$H+}
uses
Classes, interfaces, jvID3v2;
const
FILE_NAME = 'YOUR_MP3_FILE'; // Replace this by the full path to your mp3 file.
var
ID3v2: TJvID3v2;
function StripEOL(AString: String): String;
begin
Result := AString;
while (Result <> '') and (Result[Length(Result)] in [#10, #13]) do
Delete(Result, Length(Result), 1);
end;
begin
ID3v2 := TJvID3v2.Create(nil);
try
ID3v2.FileName := FILE_NAME;
ID3v2.Open;
WriteLn('Album: ', ID3v2.Texts.Album);
WriteLn('Artist: ', StripEOL(ID3v2.Texts.LeadArtist.Text));
WriteLn('Band: ', ID3v2.Texts.Band);
WriteLn('Orig Artist: ', StripEOL(ID3v2.Texts.OrigArtist.Text));
WriteLn('Title: ', ID3v2.Texts.Title);
WriteLn('Year: ', ID3v2.Texts.Year);
WriteLn('Genre: ', StripEOL(ID3v2.Texts.ContentType.Text));
finally
ID3v2.Free;
end;
ReadLn;
end.