Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:59 am
by Wilfred Verkley >> Mon, 29 Jan 2001 20:58:34 GMT
Jade can be a bit clumsy to do these kind of things though, becuase unlike other languages where you can just define a record structure for the entire ID3 tag, with Jade youve got to manually read or seperate each seperate field (title, artist, album etc).
i.e.
vars
f : File;
s : String;
title, artist, album, year, comment : String;
genre : Integer;begin
create f;
f.kind := File.Kind_Binary;
f.openInput ('brady-bunch-theme.mp3');
f.seek (f.fileLength - 128);
s := f.readBinary (128).String;
if s.length = 128 and s [1:3] = 'TAG' then
title := s [4:30];
artist := s [34:30];
album := s [64:30];
year := s [94:4];
comment := s [98:30];
genre := s [128:1].Character.Integer;
endif;
epilog
delete f;
end;