[fpc-pascal] ID3v2 - Reading and writing MP3 metadata

luciano de souza luchyanus at gmail.com
Thu May 9 19:14:13 CEST 2013


Hello listers,
I friend has sent me a component to read and write mp3 tags. In
particular, I am interested in the ID3v2 pattern.
In theory, the attatched component could do what I want. I can't make
sure, but I think it is not working very well.
When I use ID3v1 tags, title, artist, album, comment, track, genre,
the sucess is total. However, when I use ID3v2 tags like "composer",
the tag is not created or updated. The executable is generated without
erros, it runs without erros, but does not fills up the "composer"
tag.
So I ask you: do you knows how to write "composer" tag in a mp3 file?
The solution can be with this or another component.
Actually, if this component is bugged, it's really sad. It's so simple
to use... let's show:

program id3;
{$mode objfpc}{$H+}

uses
sysutils, id3v2;

var
tagger: TID3v2;

BEGIN
tagger := TID3v2.create;
try
with tagger do
begin
track := StrToInt64Def('12', 0);
title := 'O meu título';
artist := 'O meu artista';
album := 'O meu álbum';
year := '2013';
comment := 'O meu comentário';
genre := 'clássico';
composer := 'O meu compositor';
SavetoFile('01.mp3');
end;
finallyt
tagger.free;
end;
END.

-- 
Luciano de Souza



More information about the fpc-pascal mailing list