PDA

Ver la Versión Completa : Leer Id3tag Pero Desde Un Cd ...


sampras
17-10-2003, 01:38:47
Por mas que busco solo encuentro esto para leer id3tag, el problema es que estoy haciendo una aplicación para catalogar mp3 desde cds y quiero guardar en la bd los datos del id3tag de cada fichero. Bien esta funcion funciona (redundante, no?), pero no funciona cuando leo un fichero desde un CD me dice que no puede habrir el fichero. POR FAVOR si sabeis de alguna otra funcion por ahy que solucione este problema, o algo cualquier cosa me sirve ( si funciona me vale). Gracias anticipadas a todos todos.

type
TID3Tag = packed record // 128 bytes
TAGID: array[0..2] of char; // 3 bytes: TAG
Title: array[0..29] of char; // 30 bytes: Titulo Canción
Artist: array[0..29] of char; // 30 bytes: Artista
Album: array[0..29] of char; // 30 bytes: Album
Year: array[0..3] of char; // 4 bytes: Año de publicación
Comment: array[0..29] of char; // 30 bytes: Comentarios
Genre: byte; // 1 byte: ID del Genero
end;


procedure TForm1.Button1Click(Sender: TObject);
const
_mp3file='C:\Canciones\Scorpions\Wind of change.mp3';
var
id3tag: TID3tag;
mp3file: Tfilestream;
begin
mp3file:=Tfilestream.create(_mp3file,fmOpenRead);
try
mp3file.position:=mp3file.size-128;
mp3file.Read(id3tag,SizeOf(id3tag));
showmessage(' Title: '+id3tag.title+#13+
' Artist: '+id3tag.artist+#13+
' Album: '+id3tag.album+#13+
' Year: '+id3tag.year+#13+
' Comment: '+id3tag.comment+#13+
' Genre: '+inttostr(id3tag.genre)
);
finally
mp3file.free;
end;
end;