Okay, looking at an ascii output, the file resembles nothing like that file format said. It shouldn't be too hard to get it though looking at it now. If you look at the strings from the first 128 bytes of the file, you can see the title and auther, so that's where you would change them. Just count the offset from the beginning to one of those strings.
[Edited by - Drakkcon on March 14, 2006 9:45:08 PM]
trouble with opening and loading a file
Thats what I did originally, but it was different in most of my mp3 music files... At the end it is all the same, and doing what I did in that snippet I get all of the information about artist title etc into that char array, I printed it out in consol to test, that isn't the problem, its just writing it back to the mp3 that is not working, I tested by adding some code to print out everything in the array right before I have the writing code above, and it is different than what is in the file... but after I run it the file is unchanged.
In the mp3 files that I looked at, the ends are all completely blank. I don't think that the offset is from the end, which is why the file is unchanged after you edit it. I meant to look at the beginning with a hex editor, within the first 128 bytes. I successfully edited the .mp3's name by overwriting this data.
I'll post code in a sec.
PS: It turns out that they use pascal style strings. There's actually an int in the data that shows how long the title is. It's right before the title text.
[Edited by - Drakkcon on March 14, 2006 11:08:19 PM]
I'll post code in a sec.
PS: It turns out that they use pascal style strings. There's actually an int in the data that shows how long the title is. It's right before the title text.
[Edited by - Drakkcon on March 14, 2006 11:08:19 PM]
I'm still working on making an ID3 tag editor, because I'm interested now.
It turns out, the reason that the dox on wotsit.org won't work is because they're out of date. Here's the spec that modern mp3s use.
Like I said, I'll post code in a while.
Never mind, it's 1:00 AM and I have to go to bed. Hope that that reference is enough man. Good luck.
It turns out, the reason that the dox on wotsit.org won't work is because they're out of date. Here's the spec that modern mp3s use.
Like I said, I'll post code in a while.
Never mind, it's 1:00 AM and I have to go to bed. Hope that that reference is enough man. Good luck.
Hmm, maybe.. for me all of mine had 128 bytes at the end described exactly as that other doc said, but they also have info at the beginning with the name\artist\etc and this is what music players are using to get the information... It is just always different in most of my files, I can't find a way to load the correct information.
If you want to change how it shows up in windows media player (or another modern player) use the ID3 v2 tags. If you want it to show up differently on a much older media player, use the 1D3 v1 tags.
That makes sense, now to figure out a way to read in them.. because they all seem a little different from eachother... maybe older and newer version?
Yes, there are currently about 4 common versions: version 1.0, 1.1, 2.0, and 2.4.
If you look in that link I posted, it tells you how you can tell which to use (in part of the header). Also, be aware that new files will have both the "ID3" tag at the beginning, and the "TAG" tag at the end, whereas old files will just have "TAG". The 2.x versions are probably the ones you want to mess with.
If you look in that link I posted, it tells you how you can tell which to use (in part of the header). Also, be aware that new files will have both the "ID3" tag at the beginning, and the "TAG" tag at the end, whereas old files will just have "TAG". The 2.x versions are probably the ones you want to mess with.
I'm getting kind of frustrated with myself... I read that doc, and it says that the tags will have an identifier, "TPE2" or "TIT1", and going through mp3's that I have, they all have this identifier followed by the title... but the sizes of spaces after the identifier is different in almost everyone, I just can't figure out how I would make a program to read these when they are all different, or most, some are the same... its really random I even noticed on some where the name was very long there was a ! character, which I'm guessing means it will be extended.. but I can't find a pattern or anything :/
Can you post the hex and ascii output? It's possible that what shows up as space in the ascii output is actually some number without a corresponding 7-bit ascii character. I thought there were random gaps, but the gaps were actually numbers that specified how long the next string was.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement