Note

This thing is extremely outdated - I suggest something like mp3info instead.

ID3 tags

Layer-3 MPEG-1 audio files (mp3's) normally do not have any sort of description or title field. The ID3 tag provides this capability. It is a 128-byte block of data appended at the end of the file.

struct id3_tag {
   char tag[3];       /* must contain "TAG" */
   char title[30];    /* song title */
   char artist[30];   /* artist name */
   char album[30];    /* album name */
   char year[4];      /* four digit year */
   char comment[30];  /* comment field */
   byte genre;        /* genre */
}

Note that NONE of these strings need be NULL-terminated. That, of course is a major pain in the ass when you're trying to read the string, but one you can get around easily.

The id3 Program

The id3 program I wrote (below) allows you to get or set the ID3 tag on an mp3 file, from the command line. The help from the program is below.

mud:~/work/id3$ id3 -h
id3 [options] filename

     -h              : this help screen
     -t <title>      : specify track name
     -a <artist>     : specify artist name
     -d <album>      : specify album
     -y <year>       : specify year
     -g <genre>      : specify genre
     -c <comment>    : specify comment
     -x              : blank out the current id3 tag
     -q              : quiet mode

If you don't specify any options, but DO provide a filename, it will just display the current ID3 tag for you.

Downloading

So you want to get this program? Well, just remember that it's not commercial software, so if it works, cool, if not, sorry.
Note that the binaries may not always be the latest versions, while id3.tgz will most certainly be.
Thanks to Aaron Griswold for compiling the Win32 version for me, and for LOTS of testing. Also thanks to Josh Rivel for finding that big, nasty bug that deleted your mp3 file...