AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tag - Id3 Tagger [CMD]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
BoBo
Guest





PostPosted: Mon Jul 31, 2006 7:12 pm    Post subject: Tag - Id3 Tagger [CMD] Reply with quote

Quote:
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 (c) 2002-2003 Case, case@mobiili.net, 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.nl/~w.speek/tag.htm.

To use tag from command line type:

Tag [options] <filenames / directories / @file_with_parameters>

[] 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 <scheme> <files>

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

Tag --test --auto --scheme <scheme> <files>

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 <x> : artist is <x>
--title <x> : title is <x>
--album <x> : album is <x>
--track <x> : track number is <x>
--comment <x> : comment is <x>
--genre <x> : genre is <x>
--year <x> : year is <x>

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" <files>

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 <newscheme> 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" <files>

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

Tag --rentag "N. T" <files>

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 <files>

or without using tags:

Tag --rename "L\N. T" --move <files>


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
<x>: any item <x> 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 <x> : set album artist to <x>
--a-title <x> : set album title to <x>
--onlyfiles : writes only filenames in playlist, no extra information
--dirname : use directory name for playlist naming
--plname <name> : use <name> as playlist name.
--slashes : use slashes '/' instead of backslashes '\' in playlists
--nospaces : replaces space by underscore in names of written files
--sort <by> : sort playlist only by <x>
--sort+ <x> : add new playlist sorting property <x>
--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 <files>

and to remove only ID3v2 tags:

Tag --removeid3v2 <files>


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

Tag fields can also be set with:
-t <item=x> : set tag item <item> to value <x>
-f <item=x> : set tag item <item> from content of file <x>
-u <item=x> : set tag item <item> to value <x> (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 <file> : copy tag information from <file>
--allow <item=x> : allow access to files with specified properties only
--auto : generate tags from filenames
--scheme <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 <scheme> : rename files to <scheme>, 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 <item> : capitalize words in tag field <item>
--tCaps <item> : capitalize only first word in tag field <item>
--tlower <item> : convert all characters to lower case in tag field <item>
--tupper <item> : convert all characters to upper case in tag field <item>
--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 <x> : set album artist to <x>
--a-title <x> : set album title to <x>
--onlyfiles : writes only filenames in playlist, no extra information
--dirname : use directory name for playlist naming
--plname <name> : use <name> as playlist name.
--slashes : use slashes '/' instead of backslashes '\' in playlists
--nospaces : replaces space by underscore in names of written files
--sort <by> : sort playlist only by <x>
--sort+ <x> : add new playlist sorting property <x>
--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 <tag> : 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 <scheme> : save screen output to file, name generated from <scheme>
--tofileext <ext> : use extension <ext> instead of .txt
--tofilen <name> : save screen output to file <name>
--nfo <file> : generate .nfo file and save to <file>
--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 <scheme> to name output
--acculen : display length more accurately
--ansioutput : don't convert output to OEM codepage
--<number> : use predefined preset <number>

[Download]
If you've reached this line. Yeeeha, you damn like to read Wink
Back to top
Venia Legendi



Joined: 27 May 2005
Posts: 35

PostPosted: Sat Aug 19, 2006 1:51 pm    Post subject: Tag.exe ID3 Tagger - minor updates Reply with quote

Case seems not to maintain tag.exe anymore, you can find the current version now here: http://synthetic-soul.co.uk/tag/

Note Moderator: User had changed named from GuidoR13
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Sat Aug 19, 2006 3:28 pm    Post subject: Reply with quote

Quote:
Many Thanks to BoBo & GuidoR13
I was searching a CLI utility like this for a long time..


Regards, Very Happy
_________________
Suresh Kumar A N
Back to top
View user's profile Send private message
Venia Legendi



Joined: 27 May 2005
Posts: 35

PostPosted: Sat Aug 19, 2006 10:14 pm    Post subject: Tag.exe Alternative Reply with quote

The above mentioned can only change/write id3v1, nevertheless it reads id3v2.

If you want to write id3v2 take a look at http://www.foobar2000.org/ 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.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Sun Aug 20, 2006 12:03 am    Post subject: Reply with quote

Dear GuidoR13, Smile

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. Sad

"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
  • to find a simple player (any freeware player) from which I can retrieve the fullpath of the current song playing.
  • 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, Smile
_________________
Suresh Kumar A N
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Sun Aug 20, 2006 7:11 pm    Post subject: Reply with quote

Quote:
I can script an On-Screen Karaoke Display!
Cool. "BoBo in the sky with diamonds, lalala la la" ...
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Sun Aug 20, 2006 8:06 pm    Post subject: Reply with quote

BoBo wrote:
Cool.


I am already half-way through!

foobar2000 allows you to customise the Titlebar info:



I have got it like this:



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

Regards, Smile
_________________
Suresh Kumar A N
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Sun Aug 20, 2006 10:21 pm    Post subject: Reply with quote

I got the code right! Very Happy

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

Code:
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, Smile
_________________
Suresh Kumar A N
Back to top
View user's profile Send private message
Venia Legendi



Joined: 27 May 2005
Posts: 35

PostPosted: Mon Aug 21, 2006 1:26 am    Post subject: evillyrics Reply with quote

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 - http://www.evillabs.sk/evillyrics/

Also check MediaMonkey as Player - you can script it in VBS and it supports events - http://www.mediamonkey.com. Also it can display song info in its tray icon (EvilLyrics uses them)
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Mon Aug 21, 2006 7:53 am    Post subject: Re: evillyrics Reply with quote

Dear GuidoR13, Smile

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

Very Happy Very Happy
Quote:
You know this: EvilLyrics - Tool for searching the lyrics to the song played in Winamp, Sonique or Foobar - http://www.evillabs.sk/evillyrics/

Yes! I did try it last year .. I do not remember why .. I did not like it
Quote:
Also check MediaMonkey as Player - you can script it in VBS and it supports events - http://www.mediamonkey.com Also it can display song info in its tray icon (EvilLyrics uses them)

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

Regards,
_________________
Suresh Kumar A N
Back to top
View user's profile Send private message
uslacker
Guest





PostPosted: Tue Sep 05, 2006 10:01 pm    Post subject: Tag.exe changes don't take Reply with quote

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:
Code:

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:

Code:

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?
Back to top
uslacker



Joined: 05 Sep 2006
Posts: 3

PostPosted: Tue Sep 05, 2006 10:04 pm    Post subject: Re: Tag.exe changes don't take Reply with quote

uslacker wrote:
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
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10667

PostPosted: Tue Sep 05, 2006 10:27 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
uslacker



Joined: 05 Sep 2006
Posts: 3

PostPosted: Wed Sep 06, 2006 2:29 am    Post subject: Reply with quote

Chris wrote:
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
Back to top
View user's profile Send private message
Venia Legendi



Joined: 27 May 2005
Posts: 35

PostPosted: Wed Sep 06, 2006 8:20 am    Post subject: Re: Tag.exe changes don't take Reply with quote

uslacker wrote:
The output:
Code:

Tags:    ID3v1, ID3v2



Tag only reads and does not write ID3v2!

A solution might be: Delete all Tags and then write ID3v1.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group