Home :: Programming :: Code Snippets :: Delphi :: Reading ID3 tags
[ Reading ID3 tags ]
Hi guys, well this is my first code snippet for SteinSOFT.net, and my English is not the best, so stay cool ;-).
Let’s begin: At first you have to put the following code in your type, like this:
TID3Tag = record
It’s nothing complicated, here we only define the types.
Now let’s create the function that is going to read the ID3-Tag informations from the mp3 song:
Buffer:array[1..128] of char;
Seek(F,FileSize(F)-128); // going on the
// beginning of the ID3-Tag in the file
BlockRead(F, Buffer, SizeOf(Buffer)); // Reading the ID3-Tag that’s
// cached in the buffer
With ID3Tag do // now we are going to copy the informations into
// variables, there’s no more to explain, I think
// everything is clear, if not you can contact me
Tada now you have all the informations of the ID3-Tag v1, and you can now put them in Labels or Edits, whatever you want. If you have any questions, feel free to ask them in the message board. You can also visit my homepage, www.seck.lu, for some Delphi software written by me.