ID3Tag editing

Cableguy

Expert
Licensed User
Longtime User
Hi Guys..

Has anyone done any work on the subject?

I'm in a new project and I will need to extract and edit the ID3Tag info from mp3's files...
Thanks in advance..
 

kolbe

Active Member
Licensed User
Longtime User
A couple years ago I worked this out. Go to ID3 - Wikipedia, the free encyclopedia to figure out the basic big picture and then Home - ID3.org for the specifics.

Basically there is v1 tag that is embedded at the end of the file. It is simple and limited to 128 bytes. It is also the most widely used.

Then there is v2 tag that is limited to 256MB, at the beginning of the file and of course more capable but more complicated to implement.

I used the standard I found at Home - ID3.org to implement what i needed. You can do it all using the byte methods and operations in basic4ppc. You build the header and then the frames you need byte by byte following the standard, then append it to the file. My advice is try the v1 because it is most widely used and straight forward.

There is already written code out there that does this and that could be converted into a library for basic4ppc I imagine but I've never ventured into creating my own library and wanted to build it from scratch.
 

dlfallen

Active Member
Licensed User
Longtime User
Here is some basic4ppc code for V1 tags. It puts various parts of the tag into appropriate text boxes. Of course, in this example I have the input file hardwired but you would want to implement a more flexible file opening subroutine. This code was adapted from a VB program I wrote to maintain my library of old radio programs, so I have no need for V2 tags.

Hope this helps,
Dave

Sub ReadTag
FileIn =
AppPath & "/" & "drth_1949_01_16_Romance_in_the_Roaring_Fourtie.mp3"
FileOpen (c1,FileIn,cRandom)
L =
FileSize(FileIn) - 128
Itag = FileGet(C1, L,128)
FileClose(C1)

Titletxt.text =
SubString(Itag, 3, 30)
Artisttxt.text =
SubString(Itag, 33, 30)
Albumtxt.text =
SubString(Itag, 63, 25)
Monthtxt.text =
SubString(Itag, 88, 3)
Daytxt.text =
SubString(Itag, 91, 2)
Yeartxt.text =
SubString(Itag, 93, 4)
Commenttxt.text =
SubString(Itag, 97, 30)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…