views:

662

answers:

3

Hi all,

I want to have a program (might be an idea for simple program), to read metadata from a Mp3 file.

My program should also able to edit these meta data. what can i do?

I got to search out for some open source code. But they have code; but not simplified idea for my job they are going to do.

When i read further i found there are thing stored in the MP3 file itself. But i am not able to make a 360 degree of idea of my baby program.

any help will be appreciated; with a program or very idea(like algorithm ). :)

+2  A: 

http://www.id3.org/Implementations would be a good place to start

+3  A: 

The last 128 bytes of a mp3 file contains meta data about the mp3 file., You can write a program to read the last 128 bytes...

UPDATE:

ID3v1 Implementation

The Information is stored in the last 128 bytes of an MP3. The Tag has got the following fields, and the offsets given here, are from 0-127.

 Field      Length    Offsets
 Tag        3           0-2
 Songname   30          3-32
 Artist     30         33-62
 Album      30         63-92
 Year       4          93-96
 Comment    30         97-126
 Genre      1           127

WARINING- This is just an ugly way of getting metadata and it might not actually be there because the world has moved to id3v2. id3v1 is actually obsolete. Id3v2 is more complex than this, so ideally you should use existing libraries to read id3v2 data from mp3s . Just putting this out there.

Jass
That is not true.
ChssPly76
@ChssPly76 ofcourse it depends on the version. Not ALL info will be in the last 128 bytes. But this is a simple approach if you just want to get data from mp3s that have id3 and id1 metadata.
Jass
Jass
Nice Jass; This much info i wanted to know from all the oceans of code and text i was stuck in to. Thanks will write my program and let you all know. @ Martijn Courteaux does this really works all the time.
vijay.shad
Fair enough. The latest version, however, is id3v2.4 and you'll be missing a lot of stuff by restricting yourself to v1. More importantly, it's rather pointless to try to do this by hand when there are perfectly good libraries available that do it for you. Look at `Brian Agnew`'s answer as well as links in my comment - this has been asked (and answered) before.
ChssPly76
You are right. Libraries is the best way to go. But sometimes you just want to get the dirty work done.. I just gave an answer i knew. I dont know about v2. I should probably put a warning or something... hmm
Jass
+1  A: 

jd3lib is a Java library that handles MP3s, and their tags. Probably a useful starting point.

Brian Agnew