Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Tag - Id3 Tagger [CMD]


  • Please log in to reply
24 replies to this topic
BoBo
  • Guests
  • Last active:
  • Joined: --

Tag is a small tool to work with tags in various compressed audio formats.
Main features:
* Support for multiple standards:
- ID3v1.x
- ID3v2.x (reading and removing)
- APE v1.0
- APE v2.0
- Vorbis comments
- FLAC comments
- Lyrics3 v2.0.
* View tags
* Generate tags from filenames
* Modify tag values manually
* Set tag values from the contents of a text file
* Tag files with information read from CDDB files
* Copy tags from one file to another
* Convert tags to different format
* Remove tags
* Rename files based on tag information
* Move files to directories generated from tag values
* Generate Winamp playlists (optionally with AlbumList extensions and playing times)
* Generate text files with information about tracks and album (format customizable)
* Decode files and name output using tag information
* Test mode that shows what would happen without actually doing anything to files

Tag is released as freeware. Use at your own risk.
Copyright © 2002-2003 Case, [email protected], http://www.ca5e.tk/
ID3v2 support with id3lib, http://id3lib.sourceforge.net/
--------------------------------------------------------------------------------


Installation:
-------------
Uncompress Tag to any directory. For easiest use I recommend including that
directory in PATH or uncompressing Tag to Windows directory.


Usage:
------
Tag is a command line tool, meaning that you have to type all the commands from
Command Prompt in Windows. If you are not familiar with Command Prompt you should
take a look at the great Frontend made by Speek.
You can download the Frontend from http://home.wanadoo....w.speek/tag.htm.

To use tag from command line type:

Tag [options]

[] means that options are optional, they are not needed
<> means that filenames / directories / @file_with_parameters are required

There are several options, to view basic options just execute Tag without any
parameters:

Tag

To view every option use parameter --help:

Tag --help

Different options are explained later in this readme.
Filenames and directories can contain wildcards '*' and '?'.
file_with_parameters is a text file that contains all the parameters you would
pass to Tag from command line.
For example *.* means every file in current directory, *.mp3 means every .mp3
file in current directory, a*.* means any file starting with 'a' in current
directory, a?.* means any file that has two characters in it's name and starts
with 'a'.
Tag also supports wildcards in directory names, for example:

*\*.mp3

means any file with extension .mp3 in all subdirectories of current directory.
If Tag gets directory name as parameter it will search all files in in.
Other basic option regarding directories and file searching is --recursive, it
tells Tag to search files also from all subdirectories. For example command:

Tag "C:\My Music\*.mp3" --recursive

will search all .mp3 files in "C:\My Music" and in all of it's subdirectories.
Filename can also be M3U playlist, Tag will then read filenames from it.
To learn more about features of Tag you can add option --test to command line
and no files will get modified.


Viewing tags:
-------------
Default mode of operation is to display contents of tags and with MP3s, MPCs and
Oggs also some information about the files.
To view this information simply call Tag with filenames as parameter. For example:

Tag *.*

will display tags of all supported files in current directory.


Tagging:
--------
You have five ways to tag your files:
1. Let Tag guess the values for you from filename
2. Tell Tag how your files are named and it will generate values
3. Manually enter tag values
4. Combination of all of the above
5. Read tag information from tag.ini file or CDDB file

Method one is easiest but it requires that your files are named using one of the
standard naming schemes. Currently Tag recognizes about 50 different schemes, so
most probably it will work.
You can test if it will work for you by using following command in the directory with
files to be tagged:

Tag --auto --test *.*

This will view tag values that would have been guessed by Tag. If you see text
"generated from name" on the screen and tag values are correct you know that guessing
works with your filenames.
To actually write the tags remove the parameter --test and use:

Tag --auto *.*

If automatic mode didn't view correct information on your files you can manually
specify the scheme used in your filenames.
Scheme is the way filenames are constructed, telling which part of the name (or directory)
corresponds to what information. This is told by using identifiers and separators, possible
identifiers are:
T = Title
A = Artist
L = Album
N = Track number
Y = Year
G = Genre
C = Comment
X = text to be disrecarded
All other text is considered as separator. For example the scheme for file

Red Hot Chili Peppers - 01 - Around The World.mp3

is

A - N - T

You don't need to worry about the filename extension, it will be automatically
ignored.
Scheme can also be used with directories, for example if our example file was

Californication\Red Hot Chili Peppers - 01 - Around The World.mp3

we can get the Album name with scheme

L\A - N - T

If your filenames have more information just add new identifiers and Tag will use
the text in your tags. If there is some text in the middle of the name that you do
not want to store in tags you can use identifier X to mark it. For example

C:\My Music\Rock\Full Albums\The Beatles\White Album\11. Blackbird.mp3

has text "Full Albums" after genre Rock, and we want to ignore that text. Scheme is

G\X\A\L\N. T

Hopefully you now understand how schemes are constructed. You can now tag your files
with command:

Tag --auto --scheme

If you first want to see what the resulting tags would be like, add parameter --test:

Tag --test --auto --scheme

If you don't want to use automatic tag generation you can of course also enter all
information manually. There are easy-to-use switches to enter standard fields and
a general switch to enter any field to tags.
Easy switches are:
--artist : artist is
--title : title is
--album : album is
--track : track number is
--comment : comment is
--genre : genre is
--year : year is

General switch is:

-t "item=x" : item is x

Multiple calls to any of these switches are possible.

These switches can also be used when automatic tag generation is used, user entered
values will always override generated values.

To tag using tag.ini or CDDB file as source your files need to be in the same
directory with the source text files. And their names must be in form "TrackNN.XXX",
NN being the track number and XXX one of the supported file extensions.
After that simply call Tag with text file as parameter, for example:

Tag *.

will search all files without extension and if they are CDDB files it will tag
tracks with the information from the file.

You can also use:

- f "item=x" : item will be set to the text contained within the external file x

This may be useful for storing cuesheet information in an APEv2 tag, for example:

Tag -f "cuesheet=X:\CDImage.ape.cue" CDImage.ape

but can be used to store any text in any tag.

NB: The text contained in the file is stored, not the file itself.


Renaming:
---------
Tag allows fast mass renaming of files to match naming scheme you specify. You
can also move the files to subdirectories according to your scheme.
The renaming can be done by using tags already in your files, or if the files
don't have tags they can be renamed based on the scheme of original names.
To rename using tags you need to tell Tag the new scheme you want with parameter
--scheme. Let's assume our file

Red Hot Chili Peppers - 01 - Around The World.mp3

has correct tags and we want to rename it to be

01. Around The World.mp3

New name uses scheme "N. T" so we call Tag with command:

Tag --rentag --scheme "N. T"

To rename files without using tags option --scheme specifies scheme of old names.
If it is not specified Tag will try to autodetect it.
Parameter --rentag is used to specify the new scheme of files. The
command to rename our example file

Red Hot Chili Peppers - 01 - Around The World.mp3

to

01. Around The World.mp3

without using tags would be:

Tag --scheme "A - N - T" --rentag "N. T"

or since the above example would be autodetected you can simply call:

Tag --rentag "N. T"

If you also want to move the files to subdirectories use option --move. To move
our example file to subdirectory Californication we would add "L\" in front of
the new scheme and add option --move to command line. So with our example file
the command would be:

Tag --rentag --scheme "L\N. T" --move

or without using tags:

Tag --rename "L\N. T" --move


Generating Playlists:
---------------------
Tag can generate playlists for your tracks, naming the lists by the name of the
directory files are in, by scheme "Album artist - Album title", or use the name
you specify.
Playlists have playing times, Winamp's display title and AlbumList extensions by
default, but if wanted they can also contain only filenames.
By default playlists are sorted by track number, but they can also be sorted by
duration: track duration
size: filesize
name: name with full path
path: only file path
basename: filename without path
extension: file extension
attrib: file attributes
time_access: time file was last accessed
time_create: time file was created
time, date: time file was last modified
bitrate: bitrate of file
channels: audio channels in file
samplerate: samplerate of file
format: audio format
: any item in tag (artist, title, track, comment, genre, year...)

Sorting order can also be reversed.
You can tell Tag to write only one playlist of all files or to write multiple
playlists, one to every directory with files.
Tag will try to automatically detect album artist and album title from tags, but
those can also be given with parameters --a-artist and --a-title.
Sorting options are given with parameter --sort, and if you want to sort by multiple
properties add new properties with parameter --sort+.

Playlist options:
--playlist : generate one playlist per directory
--oneplaylist : generate one playlist from all files
--playlists : generate one playlist per album in current directory
--a-artist : set album artist to
--a-title : set album title to
--onlyfiles : writes only filenames in playlist, no extra information
--dirname : use directory name for playlist naming
--plname : use as playlist name.
--slashes : use slashes '/' instead of backslashes '\' in playlists
--nospaces : replaces space by underscore in names of written files
--sort : sort playlist only by
--sort+ : add new playlist sorting property
--sortdesc : sort in descending order

Example to write one big playlist of all .mp3 files and sort the playlist by
path and by track number:

Tag --oneplaylist --sort path --sort+ track --recursive *.mp3


Removing tags:
--------------
You can remove all supported tags from files and with ID3v2 version also just
ID3v2 tags.
To remove all tags use command:

Tag --remove

and to remove only ID3v2 tags:

Tag --removeid3v2


All options:
------------
--title : set title to
--artist : set artist to
--album : set album to
--year : set year to
--comment : set comment to
--track : set track number to
--genre : set genre to

Tag fields can also be set with:
-t : set tag item to value
-f : set tag item from content of file
-u : set tag item to value (x is UTF-8 coded)

--help : show full help
--hideinfo : don't display file information
--hidetags : don't display tags
--hidenames : don't display filenames
--simple : use simple tag display format
--recursive : search files recursively in all subdirectories
--fromfile : copy tag information from
--allow : allow access to files with specified properties only
--auto : generate tags from filenames
--scheme : specify file structure scheme (ie. L/A - N - T)
--autoscheme : select automatically best scheme from list of schemes
--nomagic : use plain schemes, disable extra automations
--chreplace : use character replacing when tagging
--rentag : rename files to match scheme, filename from tag data
--rename : rename files to , filename generated from old name
--move : when renaming move files to subdirectories
--overwrite : overwrite existing files when renaming
--trackinc : use incremental track numbering
--caps : capitalize words
--Caps : capitalize only first word
--lower : convert all characters to lower case
--upper : convert all characters to upper case
--tcaps : capitalize words in tag field
--tCaps : capitalize only first word in tag field
--tlower : convert all characters to lower case in tag field
--tupper : convert all characters to upper case in tag field
--nozero : ignore leading zeros on track numbers
--zeropad : add trailing zero to track number if missing
--commafix : fix comma separated artist field (x, the -> the x)
--spacefix : replaces underscore (_) and %20 with space
--itemfix : fix item names in APE v1.0/2.0 tags
--umlfix : fix umlauts (ae -> ä, oe -> ö, ue -> ü)
--swapta : swap title <--> artist
--remove : remove all tags
--removeid3v2 : remove only ID3v2 tags
--removeid3v2u : remove only unnecessary ID3v2 tags (fields fit in ID3v1)
--playlist : generate one playlist per directory
--oneplaylist : generate one playlist from all files
--playlists : generate one playlist per album in current directory
--a-artist : set album artist to
--a-title : set album title to
--onlyfiles : writes only filenames in playlist, no extra information
--dirname : use directory name for playlist naming
--plname : use as playlist name.
--slashes : use slashes '/' instead of backslashes '\' in playlists
--nospaces : replaces space by underscore in names of written files
--sort : sort playlist only by
--sort+ : add new playlist sorting property
--sortdesc : sort in descending order
--newdate : don't keep files original date/time
--oldtype : use old tag format
--ape2 : default to APE v2.0
--force : force use of selected tag type
--extid3 : extend over long title field into comment field with id3
--nocheck : don't check file extension
--test : test mode, no files will be modified
--tofile : save screen output to file, name generated from
--tofileext : use extension instead of .txt
--tofilen : save screen output to file
--nfo : generate .nfo file and save to
--listdefaults : view default settings
--listexceptions : view list of exceptions in capitalize function
--listgenres : view list of possible ID3v1 tag genres
--listpresets : view list of defined presets
--decode : use external decoder and use to name output
--acculen : display length more accurately
--ansioutput : don't convert output to OEM codepage
-- : use predefined preset

[Download]

If you've reached this line. Yeeeha, you damn like to read :wink:

Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005
Case seems not to maintain tag.exe anymore, you can find the current version now here: <!-- m -->http://synthetic-soul.co.uk/tag/<!-- m -->

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Many Thanks to BoBo & GuidoR13
I was searching a CLI utility like this for a long time..
kWo4Lk1.png

Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005
The above mentioned can only change/write id3v1, nevertheless it reads id3v2.

If you want to write id3v2 take a look at <!-- m -->http://www.foobar2000.org/<!-- m --> it has a rare known command line mode for tagging also:

foobar "/tag:album=take a look at the qouting;artist=it's somewhat peculiar;genre=this can be anything" "my mp3.mp3" /hide /exit

You may change the settings with the gui to the tag type you need, try also foobar /tag:help and foobar /help

If you're searching a good gui, try mp3bookhelper (from sourceforge.net). It's regular expressions are marvelous.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear GuidoR13, :)

Thanks for the additional info.
I have been a loyal user of Musicmatch Jukebox for many years till now. It offers excellent super-tagging factilities. I prefer to use it for maintaining my MP3 library of songs. I do not use it for playing songs except for running long playlists.

However, in the version I am currently using (MMJB 7.5), I have to opt tag-edit dialog to view the Lyrics of a song, which is not feasible, since I cannot access the player unless that dialog/GUI is closed. :(

"Tag CLI does the job" - It can dump the tag-info (along with the Lyrics) to a text file which I can manipulate easily with AHK.

My immediate plan is to provide an item in the right-click context menu for viewing lyrics ( in Windows Explorer )

But the real challenge is
[*:37gfw01l]to find a simple player (any freeware player) from which I can retrieve the fullpath of the current song playing.
[*:37gfw01l]to retrieve the Tracktime of the current song playing.I need the right SendMessage parameters (to any player) to fetch the above info.

If the above is made possible, I can script an On-Screen Karaoke Display! :idea:

Any pointers would be helpful.. Thanks again.

Regards, :)
kWo4Lk1.png

BoBo
  • Guests
  • Last active:
  • Joined: --

I can script an On-Screen Karaoke Display!

Cool. "BoBo in the sky with diamonds, lalala la la" ...

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Cool.


I am already half-way through!

foobar2000 allows you to customise the Titlebar info:

Posted Image

I have got it like this:

Posted Image

Using WinGetTitle & StringSplit we can extract the filename which can be used with Tag.exe to extract the Lyrics!

Regards, :)
kWo4Lk1.png

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
I got the code right! :D

Press Control+F2 when foobar is active and Lyrics will be displayed as text file:

FBTitle:="foobar2000 v0.9.1"
FBClass:="{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1"

^F2::
WinGetClass,Class,A
IfNotEqual,Class,%FBClass%,Exit
WinGetTitle,Title,ahk_class %FBClass%
StringSplit,Field,Title, |
Field2=%Field2%
Runwait, Cmd.exe /C Tag.exe --tostdoutn "LYRICS" "%Field2%" > Lyrics.txt,,Hide
IfExist, Lyrics.txt,Run, Lyrics.txt
Return

Regards, :)
kWo4Lk1.png

Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005
Hm, I only sing in the shower and the shower curtain is not TCP/IP aware... :wink:

You know this: EvilLyrics - Tool for searching the lyrics to the song played in Winamp, Sonique or Foobar - <!-- m -->http://www.evillabs.sk/evillyrics/<!-- m -->

Also check MediaMonkey as Player - you can script it in VBS and it supports events - <!-- m -->http://www.mediamonkey.com<!-- m -->. Also it can display song info in its tray icon (EvilLyrics uses them)

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear GuidoR13, :)

Hm, I only sing in the shower and the shower curtain is not TCP/IP aware... :wink:


:D :D

You know this: EvilLyrics - Tool for searching the lyrics to the song played in Winamp, Sonique or Foobar - <!-- m -->http://www.evillabs.sk/evillyrics/<!-- m -->

Yes! I did try it last year .. I do not remember why .. I did not like it

Also check MediaMonkey as Player - you can script it in VBS and it supports events - <!-- m -->http://www.mediamonkey.com<!-- m --> Also it can display song info in its tray icon (EvilLyrics uses them)

I am no good at VBS :( But the player looks promising.. I will give it a try.
Thanks for providing the link.

Regards, Posted Image
kWo4Lk1.png

uslacker
  • Guests
  • Last active:
  • Joined: --
I have problems with tag.exe (v 2.0.47) saving my changes. It apears to run without error, but the tag doesn't change. If I run Tag against the file it shows the new tag, but running a second time shows the original setting.


In this example I'm trying to reset the title to "JBB - 01"
Here's the command-line:
tag --title "JBB - 01" 01-*.mp3

The output:
01-AudioTrack 01.mp3
Format:  MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 127 kbps, playtime 03:25
Tags:    ID3v1, ID3v2
Title:   JBB - 1
Artist:  Burke, Jame Lee
Album:   Jolie Blon Bounce
Year:    2002
Track:   1
Genre:   Speech
Comment:
ID3v1 tag written.

OK - that looks good!

Then the output of tag 01-*.mp3:

C:\Documents and Settings\gmartin\My Documents\My Music\MP3\Burke, James Lee\Jolie Blon Bounce\01-AudioTrack 01.mp3
Format:  MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 127 kbps, playtime 03:25
Tags:    ID3v1, ID3v2
Title:   AudioTrack 01
Artist:  Burke, Jame Lee
Album:   Jolie Blon Bounce
Year:    2002
Track:   1
Genre:   Speech
Comment:

What happened? I've tried tag numerous times in the past 6 months and always see this result. I've checked tag.cfg and don't see a test option listed. I'm no idiot (IMHO!) and I know the developer isn't. What am I missing?

uslacker
  • Members
  • 3 posts
  • Last active: Oct 16 2006 12:58 AM
  • Joined: 05 Sep 2006

I have problems with tag.exe (v 2.0.47) saving my changes. It apears to run without error, but the tag doesn't change. If I run Tag against the file it shows the new tag, but running a second time shows the original setting.

<snip>

What happened? I've tried tag numerous times in the past 6 months and always see this result. I've checked tag.cfg and don't see a test option listed. I'm no idiot (IMHO!) and I know the developer isn't. What am I missing?


Sorry for the repost - I hadn't registered and want to see replies...
\\uslacker

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
You might try contacting the author(s) of tag.exe as listed in the top post above. They're unlikely to see your request here.

uslacker
  • Members
  • 3 posts
  • Last active: Oct 16 2006 12:58 AM
  • Joined: 05 Sep 2006

You might try contacting the author(s) of tag.exe as listed in the top post above. They're unlikely to see your request here.


I'm working on that - just wondering if anyone here had any thoughts.
\\uslacker

Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005

The output:

Tags:    ID3v1, ID3v2


Tag only reads and does not write ID3v2!

A solution might be: Delete all Tags and then write ID3v1.