Mp3tag

What is mp3tag ?

Mp3tag is an Objective-Caml library which can be used in other tools to read, write or graphically edit tags (v1 or v2) in mp3 files.

It comes with the mp3tag and cddbtag example tools (see below).

Mp3tag project page on Savannah.

Download

You can get mp3tag here.

Documentation

The library interface can be browsed here.

The mp3tag tool

The mp3tag tool included can be used to modify tags in mp3 files, or rename files according to tags. Here are some examples of usage:
mp3tag file_1.mp3 ... file_n.mp3
Print tags of the given files.
mp3tag -a "Les Cowboys Fringants" -l "Attache ta tuque" *.mp3
Set artist and album tags in all mp3 files of the current directory.
mp3tag -a "Les Cowboys Fringants" -l "Attache ta tuque" -t "Toune d'automne" -n 11 -g 102 file.mp3
Set artist, album, title, track number and genre tags in file.mp3.
mp3tag -e file_1.mp3 ... file_n.mp3
Graphically edit tags in each given file.
mp3tag -r file_1.mp3 ... file_n.mp3
Rename the given files according to their tags, with the default name format.
mp3tag -r -f 1 file_1.mp3 ... file_n.mp3
Rename the given files according to their tags, with the predefined format "1".
mp3tag --formats
Print the list of predefined renaming formats.
mp3tag -F "%n - %t" file_1.mp3 ... file_n.mp3
Rename the given files according to their tags with the given format. Here, each file will be renamed as <track number> - <title>.mp3. Where to use values of tags in a format is specified by %a, %t, %l, %n, %g, %c, %y.
mp3tag --copy -t "Le plombier" file1.mp3 file2.mp3
Copy tags from file1.mp3 to file2.mp3, but with a different title tag.

The cddbtag tool

The cddbtag tool included can be used to modify tags in mp3 files, by using a CDDB server to get artist, album and tracks corresponding to the given mp3 files. Here are some examples of usage:
cddbtag file_01.mp3 file_02.mp3 ... file_n.mp3
Use the given files, in the given order, to build the discid, then query the CDDB server and, if information could be retrieved, set tags in the given .mp3 files.
cddbtag -t file_01.mp3 file_02.mp3 ... file_n.mp3
Same as above but run in test mode: it prints the information retrieved but does not write tags in the files.
cddbtag -s mycddbserver.org -p 4000 file_01.mp3 file_02.mp3 ... file_n.mp3
Here we specify a different CDDB server and port to connect to.

Authors

Maxence Guesdon
Xavier Leroy (reading and writing of tags)