HydrogenAudio

Hydrogenaudio Forum => Uploads => Topic started by: Synthetic Soul on 2004-08-22 21:00:17

Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2004-08-22 21:00:17
2006-02-08 11:53 :
2.0.45 released.  As well as --tocue, --tocuen and --tocuea, I have now added the --paranoid switch which will cause warnings and non-critical errors to return a non-zero return code, so that this can be picked up in a script.  Thanks to R Hannes Beinert for the suggestion and patch.

2005-12-08 13:24 :
2.0.45b9:  Added code to fix memory leak.  Report and code kindly provided by Steve Vibert.

2005-12-08 13:24 :
2.0.45b8:  Added --tocue, --tocuen and --tocuea.  libVorbis 1.1.2 & libOgg 1.1.3.

2005-04-21 22:00 BST:
If you downloaded Tag 2.0.43 before 19:30 BST you may want to download it again (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html#download).

See [a href='index.php?act=findpost&pid=292528']this post[/a] for more info.

2005-04-21:
Quote
a small bug report for 2.0.42. View APE 3.98 and higher files' tags and the details field is incorrect, for example: "Details: 24 Hz, playtime 42274:53:30". The 24 Hz part is always constant.

Version 2.0.43 has been uploaded. (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html#download)

v3.98+ APE files are now detailed correctly. Also, the 10KB limit when using the -f switch has been removed.

Update: wapet has also been updated now, so that the 10KB limit no longer applies.  wapet 0.5 available here. (http://www.neilpopham.pwp.blueyonder.co.uk/wapet.html#download)

2005-02-07:
I thought I may as well record on forum that I have updated Case's Tag (http://www.saunalahti.fi/~cse/) with libFLAC 1.1.2.  You can get it here (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html).

It now uses libFLAC 1.1.2, libOgg 1.1.2 and libVorbis 1.1.0 - all the most recent releases.

I see from the FLAC changelog (http://flac.sourceforge.net/changelog.html) that there have been some changes relevant to VORBIS tagging, so I thought I may as well.

Original Post:
This topic explains the history of this amendment

[a href='index.php?showtopic=25921']EAC+MAC+TAG+PAR2[/a]

There is a little information, and all the downloads here:

http://synthetic-soul.co.uk/tag/ (http://synthetic-soul.co.uk/tag/)

I hope someone else finds this useful as well.

wapet  is also now available, with the additional -f switch (http://synthetic-soul.co.uk/wapet/).
Title: Changes Made to TAG.EXE
Post by: phwip on 2004-08-23 09:57:24
Thanks for this.  Tag is for me an incredibly useful tool and these are two valuable enhancements.  I have tested both changes and in general they look good.

I have however come across one bug with the file-based tagging: I tried to load into a tag a file that contained a British pound sign (£).  This seemed to work but when I then view the tags using Tag it doesn't show the pound sign.  And if I load the file into foobar2000 it doesn't show that tag at all.

I did some testing and found that if I write the tag using foobar2000 it adds two bytes to the file for that character rather than one.  The first byte is hex C2, the second is hex A3 which corresponds to the £ sign.  So for some reason it adds that additional byte before the £ sign (but doesn't display it when viewing the tag).  I also found that when Tag.exe adds a tag containing a £ sign using the -t method it also adds this additional A3 byte.  So it is only the file loading method that is not doing this.

Of course I don't know that this issue is specific to £ signs, but so far that's the only character I've found that triggers it.  Also I've only tested this on OptimFrog .ofr files with APEv2 tags so far, so it may not be an issue with other file or tag types.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2004-08-23 12:05:58
Thanks for the feedback phwip.

I will investigate this.

I am a little confused as I let the existing Tag code deal with all the complex bits.  If I may I would like to take this opportunity (as I'm sure it will come up again)  to explain how the file loading bit (-f) works, in comparision to setting an absolute value (-t)

The -t switch code:The -f switch code:All the clever stuff is still done by Case's code - I'm just intercepting a "<text1>=<text2>" parameter, swapping it with "<text1>=<text3>", and then letting it carry on down the road.

I can only assume this is another weird side of reading character by character from the text file (as per the disappearance of any carriage returns).

I will definately try to resolve this.  I'm still waiting for a competent C++ developer to give me some pointers...
Title: Changes Made to TAG.EXE
Post by: phwip on 2004-08-23 13:20:53
I've tested this a little further with APEv2, APEv1 and ID3v1 tags, all against mp3 files this time.

If I tag using the switch -t artist=a£b and then force one of the above tag types, all of the files then correctly show the artist as a£b when viewed via foobar2000 or Tag itself.  If I view the files with a hex editor the ID3v1 and APEv1 tags are both internally stored as 61 A3 62 which are the corresponding codes for a£b.  The APEv2 tag is stored internally as 61 C2 A3 62.

However, if I use the switch -f artist=test.txt where test.txt contains the single line a£b then all the files show the artist as ab when viewed by Tag, and the same with foobar2000 except for the APEv2 tagged file for which foobar2000 does not see an artist tag at all.  In a hex editor I see that the ID3v1 and APEv1 tags are stored as 61 62 and the 61 A3 62.

So the problem affects all three tag types although the internal storage method is slightly different for APEv2 tags than the other two.

I hope this is useful information.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2004-08-23 14:53:06
I'm pretty sure I've resolved this now.

The -t switch parameters were getting converted to UTF8 from UNICODE immediately, and then passing a flag saying they were UTF8.

My -f switch parameters were passing the flag, but had not been converted.

I have stopped them setting the flag, so they are now converted to UTF8 just before they are written.

I have tried a few different file types, and ID3v1 and APEv2, and I get no problem now.

I would quite like to have a test string with more test characters than "£" - but as I am pretty sure that this was the problem I am equally sure that any similar issues would have been resolved.  I don't understand enough about UNICODE and UTF8 to know offhand.
Title: Changes Made to TAG.EXE
Post by: phwip on 2004-08-23 16:35:52
Excellent.  Overcomes the problem for all the tag types I tested (ID3v1, APEv2 and APEv1).  Thanks.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2004-08-23 17:06:55
Good news.

I'm hoping to get chance to test out the whole cycle tonight:

EAC -> MAREO -> MAC /  TAG / PAR2 (http://www.neilpopham.pwp.blueyonder.co.uk/cd_backup.html)

I'll be interested to see how it goes...  I'm sure it will go smoothly... 

Thanks for your support phwip - please let me know if you find any other problems.

[span style='font-size:8pt;line-height:100%']Edit: added link to the guide I wrote subsequently.[/span]
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-02-07 13:35:52
I thought I may as well record on forum that I have updated Case's Tag (http://www.saunalahti.fi/~cse/) with libFLAC 1.1.2.  You can get it here (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html).

It now uses libFLAC 1.1.2, libOgg 1.1.2 and libVorbis 1.1.0 - all the most recent releases.

I see from the FLAC changelog (http://flac.sourceforge.net/changelog.html) that there have been some changes relevant to VORBIS tagging, so I thought I may as well.
Title: Changes Made to TAG.EXE
Post by: Cutter on 2005-02-08 20:01:10
Hello!

This program is really useful for creating playlists. However, I can't find a list of tag types for use with the --force <tag> command. I want to force tag.exe to read ID3v2 instead of ID3v1 as it seems to do by default. I tried --force ID3v2 but it didn't recognized the tag type.
Thanks in advance for your help.
Title: Changes Made to TAG.EXE
Post by: Compact Dick on 2005-02-09 01:40:01
Hi Synthetic Soul,

a small bug report for 2.0.42. View APE 3.98 and higher files' tags and the details field is incorrect, for example: "Details: 24 Hz, playtime 42274:53:30". The 24 Hz part is always constant.

Thanks for the much-needed updates.

Quote
I tried --force ID3v2 but it didn't recognized the tag type.

Tag does not write ID3v2 tags, it only reads them.

Cheers,
CD
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-02-09 12:13:06
Quote
This program is really useful for creating playlists.
Please bear in mind the original program, which still accounts for 99% of this version, was written by Case (http://www.saunalahti.fi/cse/).  I have only added the -f switch and updated the libraries.  He da man!

Quote
I can't find a list of tag types for use with the --force <tag> command. I want to force tag.exe to read ID3v2 instead of ID3v1 as it seems to do by default. I tried --force ID3v2 but it didn't recognized the tag type.
I believe that --force is for writing only.  I don't think you can tell Tag to display the tags from a certain format, but I may be wrong.

NB: Acceptable values for --force are:

Quote
a small bug report for 2.0.42. View APE 3.98 and higher files' tags and the details field is incorrect, for example: "Details: 24 Hz, playtime 42274:53:30". The 24 Hz part is always constant.
Please see my response to Cutter - I have made no changes to this area.  I have tested with Tag 2.0.39, Case's last version, and this reports the files as 24Hz also - which is unsurprising to me, as I have been nowhere near that code.

I don't understand enough in this area to try to explain I'm afraid.  I have done a little investigation (I'm bored) and it does seem the APE header reading is a little lacking - a lot more information (e.g.: bitrate, channels) is attempted to be read and output, but only the frequency and playtime appear to make it through.  On the few files I've checked the playtime is also wrong.

Edit: Thinking about it, I guess this may be because the header format has changed since Tag was last worked on by Case (April 2003).  At this time I believe 3.97 was the latest version - 3.98a1 wasn't released until May 2003.  Maybe someone can confirm this.  Unfortunately I am not skilled enough to update the code. 
Title: Changes Made to TAG.EXE
Post by: Skates on 2005-03-08 02:13:03
Any chance of adding support for the removal of specific tags?  Currently only all tags can be removed or just ID3v2 from MP3s.  TIA
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-03-08 08:57:19
To remove an individual tag in Tag just use:

TAG.EXE -t COMENT= MyFile.ext

The above command will remove the COMENT tag completely from the file MyFile.ext (by simply specifying nothing after the equals sign).

If your tag had spaces you would need to use:

TAG.EXE -t "MY COMENT=" MyFile.ext
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-21 12:05:33
Quote
a small bug report for 2.0.42. View APE 3.98 and higher files' tags and the details field is incorrect, for example: "Details: 24 Hz, playtime 42274:53:30". The 24 Hz part is always constant.

Version 2.0.43 has been uploaded.

v3.98+ APE files are now detailed correctly.

Also, the 10KB limit when using the -f switch has been removed.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-21 12:14:21
Quote
Quote
a small bug report for 2.0.42. View APE 3.98 and higher files' tags and the details field is incorrect, for example: "Details: 24 Hz, playtime 42274:53:30". The 24 Hz part is always constant.
Please see my response to Cutter - I have made no changes to this area.  I have tested with Tag 2.0.39, Case's last version, and this reports the files as 24Hz also - which is unsurprising to me, as I have been nowhere near that code.

I don't understand enough in this area to try to explain I'm afraid.  I have done a little investigation (I'm bored) and it does seem the APE header reading is a little lacking - a lot more information (e.g.: bitrate, channels) is attempted to be read and output, but only the frequency and playtime appear to make it through.  On the few files I've checked the playtime is also wrong.

Edit: Thinking about it, I guess this may be because the header format has changed since Tag was last worked on by Case (April 2003).  At this time I believe 3.97 was the latest version - 3.98a1 wasn't released until May 2003.  Maybe someone can confirm this.  Unfortunately I am not skilled enough to update the code. 

The problem was, as suggested in my edit, that 2.39 knew nothing about the new APE header format.

I have persevered and, in contradiction to my post above, I was just skilled enough to make the changes.
Title: Changes Made to TAG.EXE
Post by: Buddy Casino on 2005-04-21 12:50:41
When trying to download 2.0.43 I get a 404...
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-21 13:04:04
Sorry - should be there (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html#download) now.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-21 17:00:03
wapet has also been updated now, so that the 10KB limit no longer applies.

wapet 0.5 available here. (http://www.neilpopham.pwp.blueyonder.co.uk/wapet.html#download)
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-21 22:08:24
If you downloaded Tag 2.0.43 before 19:30 BST you may want to download it again (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html#download).

I discovered an issue in Case's original code that resulted in screwy bitrate values being reported on long files (e.g.: a CD image).

To resolve I changed the line:

Code: [Select]
(Info->Details.Duration > 0)  ?  (long)(Info->FileSize * 8 / Info->Details.Duration + 500) / 1000  :  0;

... to:

Code: [Select]
(Info->Details.Duration > 0)  ?  (long)(((signed __int64)Info->FileSize * 8 / Info->Details.Duration) + 500) / 1000  :  0;

..which correctly results in, e.g., 859 kbps, not 4294966745 kbps.

I can only assume this is some sort of overflow bug, which is why I added the (signed __int64).  Maybe someone has a more elegant solution.

Sorry, I was testing on track files, so didn't notice earlier.
Title: Changes Made to TAG.EXE
Post by: Supernaut on 2005-04-21 23:24:05
Quote
I can only assume this is some sort of overflow bug, which is why I added the (signed __int64).  Maybe someone has a more elegant solution.

Right, the code overflows when the file size is over 512MB. Your solution is elegant enough, though not portable (I'm not sure if it's meant to be, but it will compile on MSVC++, but not gcc).
Title: Changes Made to TAG.EXE
Post by: xmixahlx on 2005-04-22 02:08:45
was gcc used to compile TAG before?
Title: Changes Made to TAG.EXE
Post by: Compact Dick on 2005-04-22 02:43:10
tag 2.0.43 reports the correct bitrate for APE files. Thank you, Synthetic Soul
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-04-22 08:56:30
Quote
Right, the code overflows when the file size is over 512MB. Your solution is elegant enough, though not portable (I'm not sure if it's meant to be, but it will compile on MSVC++, but not gcc).

Thanks for the confirmation Supernaut - it's good to have my code scrutinised by a competent C++ programmer.  If you know any of the story behind this you'll know I don't count myself in that group.

Quote
was gcc used to compile TAG before?

The original source from Case (http://www.saunalahti.fi/~cse/files/) has MSVC++ workspace/project files - so I think it's always been MSVC++.  I'm using 6, not .NET/7 (although I have both).

Edit: also, the reason I tried (signed __int64) was that Case had used it one or two lines previous.  So I guess that confirms it has always been MSVC++ only.

Quote
tag 2.0.43 reports the correct bitrate for APE files. Thank you, Synthetic Soul

No problem.  Ever since you mentioned it it's bugged me, but I have just really struggled working out the new APE header.

Edit: Example of improvements:

C:\DOS>tag *.ape
Tag - Automatic Tag from filename
Copyright © 2002-2003 Case.  Minor additions by Neil Popham, 2004-2005
Version 2.0.43, Compiled 2005-04-21

C:\DOS\cdimage.ape
Format:  Monkey's Audio 3.99 (High)
Details: 44100 Hz Stereo, 808 kbps, playtime 49:19
File has no known tags.

C:\DOS\cdimage397.ape
Format:  Monkey's Audio 3.97 (Normal)
Details: 44100 Hz Stereo, 817 kbps, playtime 49:19
File has no known tags.


C:\DOS>tag-2.0.39 *.ape
Tag - Automatic Tag from filename      Copyright © 2002-2003 Case
Version 2.0.39b, Compiled 2003-04-11

C:\DOS\cdimage.ape
Format:  Monkey's Audio 3.99
Details: 24 Hz, playtime 1060:01:46
File has no known tags.

C:\DOS\cdimage397.ape
Format:  Monkey's Audio 3.97
Details: 44100 Hz Stereo, 4294966663 kbps, playtime 49:19
File has no known tags.
Title: Changes Made to TAG.EXE
Post by: Bryanhoop on 2005-07-06 00:22:26
Rename From Tag Then Tag From Filename
Code: [Select]
@ECHO OFF
Echo Generate Filenames (Test)
Pause
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --test --trackinc --zeropad --scheme "N - A - L [Y] - T" *.mp3 --recursive
ECHO Do Same Without Testmode
pause
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --trackinc --zeropad --scheme "N - A - L - T" *.mp3 --recursive
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --trackinc --zeropad --scheme "N - A - L [Y] - T" *.mp3 --recursive
Echo Generate Tags (Test)
pause
C:\progra~1\tag\tag.exe --auto --test --caps --spacefix --removeid3v2 --force apev2 --trackinc --zeropad --autoscheme *.mp3 --recursive
ECHO Do Same Without Testmode
pause
C:\progra~1\tag\tag.exe --auto --removeid3v2 --caps --spacefix --force apev2 --trackinc --zeropad --autoscheme *.mp3 --recursive
pause


Tag From Filename Then Rename From Tag
Code: [Select]
@ECHO OFF
Echo Generate Tags (Test)
pause
C:\progra~1\tag\tag.exe --auto --test --caps --spacefix --removeid3v2 --force apev2 --trackinc --zeropad --autoscheme *.mp3 --recursive
ECHO Do Same Without Testmode
pause
C:\progra~1\tag\tag.exe --auto --removeid3v2 --caps --spacefix --force apev2 --trackinc --zeropad --autoscheme *.mp3 --recursive
Echo Generate Filenames (Test)
Pause
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --test --trackinc --zeropad --scheme "N - A - L [Y] - T" *.mp3 --recursive
ECHO Do Same Without Testmode
pause
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --trackinc --zeropad --scheme "N - A - L - T" *.mp3 --recursive
C:\progra~1\tag\tag.exe --rentag --itemfix -t Comment= --trackinc --zeropad --scheme "N - A - L [Y] - T" *.mp3 --recursive



Thanks for making such a great command line tool! The batch files above are by far the easiest way for me to tag and rename my mp3 collection! I just drop the appropriate one into my music subdirectory and run it! There are several other things you could do to....but this is the easiest. Just make sure to include your filename scheme at the TOP of the tag.cfg auto-guesser section, and change the options above to match your tag.exe location and filename scheme.

If the author would allow a way to edit tags and/or filenames using general expressions, that would be very much appreciated! (i.e. remove everything in parentheses, and everything after and including feat., ft., ft, feat, etc.). If anyone has a way to do this as of now, please fill me in! Also, could you explain what trackinc does? I thought it was an auto-track numbering switch, but it doesn't seem to do that. That ability would be very much appreciated! Thanks!
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-12-08 13:26:55
Following a request from [proxima] I have made some amendments to Tag.
Quote
Code: [Select]
 --tocue <scheme>  : output cuesheet tag to file, name generated from <scheme>
 --tocuen <name>   : output cuesheet tag to file <name>
 --tocuea          : output cuesheet tag to file, name generated from source

<snip>

Outputting cuesheets:
---------------------
You can output the contents of an embedded cuesheet to file using one of the
--tocue switches.

To output the content to a file whose name is detirmed by tag values:

  Tag --tocue "%A - %L" <files>

To output the content to a specific file:

  Tag --tocuen "C:\My Music\CDImage.cue" "C:\My Music\CDImage.wv"

To output the content to a file with the same name as the source:

  Tag --tocuea <files>

If the file is "C:\CDImage.wv" the cuesheet will be called "C:\CDImage.wv.cue"

By default, using --tocue and --tocuea will overwrite existing files,
but --tocuen will append to an existing file.  To make --tocuen overwrite use
the --overwrite switch (hack).
It's still in beta so I haven't added it to the page yet, but I thought I'd let people know, to maybe get some feedback.  You can download it here (http://www.synthetic-soul.co.uk/files/tag_2.0.45b9.zip).

Thanks to [proxima] for the idea, and feedback.

I hope some others find it useful.

NB: [proxima] did ask whether Tag could amend the FILE reference to point to the audio file where necessary. This is unfortunately beyond my C++ skills (which are 50% copy'n'paste and 50% basic syntax).  I am hoping that David will implement this in WavPack (as discussed in another thread) and then I can plagiarise his code.  I can't believe there is no easy-looking way of using regular expressions with C/C++ (Tag really seems to be C syntax from my limited experience).

Edit: @ [proxima]: Again, thanks for your help. FYI: Since Beta 5 I am no longer using the --tofile code, so:

TAG --tocuea --recursive *.wv

... works. 


Edit: Updated link to beta 9
Title: Changes Made to TAG.EXE
Post by: [proxima] on 2005-12-08 13:49:03
Quote
Edit: @ [proxima]: Again, thanks for your help. FYI: Since Beta 5 I am no longer using the --tofile code, so:

TAG --tocuea --recursive *.wv

... works. 
[a href="index.php?act=findpost&pid=348607"][{POST_SNAPBACK}][/a]


Thanks for your work Syntetic Soul, it is really appreciated.
I'm happy you finally ended up with a successful recursive mode
Title: Changes Made to TAG.EXE
Post by: [proxima] on 2005-12-10 01:12:17
@Synthetic Soul: the new switches you added return always zero even if the input file does not contain an embedded cuesheet. It would be useful for batchfiles creation if you can return "non zero" in this and the other possible failure cases.

edit: i've just found a workaround with batchfiles, i can check for filesize. You can ignore this request 
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2005-12-10 19:51:43
I can't really return a non-zero value, as it is not an error, per se, if no cuesheet tag exists.

You can use --tocue/a/n while tagging, or any other action, so returning an error would be inaccurate in many situations.

I could report when no cuesheet tag is found, but I guess that is of no practical use.

Anyway, I'm glad that you found a workaround.
Title: Changes Made to TAG.EXE
Post by: JJZolx on 2006-01-13 20:49:53
I'm sure TAG.EXE has a long and storied past, but I haven't been able to find that story anywhere.  What's the reason that the writing of id3v2 tags is not supported by this tool?
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2006-01-13 22:18:00
Much of the story I can't explain.  I am a relative noob to this forum.

My small part of the story is detailed in this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=25921).  In essence, I wanted to embed a cuesheet in my Monkey's Audio files as part of an automated archive process.  I asked Case whether he would add the functionality to set the tag from the contents of a text file and he replied that he had no interest in updating Tag.  So, I took it upon myself to add the functionality. I never intended to do anything else with Tag, but although the application was popular, no-one else seemed interested in updating it further, so as libraries that Tag uses were updated  I have updated my mods of Tag, in case they are relevant.  I have made a few other minor amendments as and when people have requested.

I have always been confused why a competent C(++) programmer has not taken on the role.

I tend to get one or two emails a week regarding Tag.  Many ask me when I will add ID3v2 tagging.  Sadly, I have to tell them that I simply don't have the skills to implement such a thing.  That said, Case didn't add ID3v2 tagging for a reason.  He must surely have the skills to utilise the ID3lib library, so I figure that ID3v2 was never meant to be.  I have always been concerned about corrupting Tag's good name, and, stupid or not, it seems to me that adding ID3v2 tagging to Tag would be sacrilegious in some way.

I know many people on the forum seem to have a low opinion of ID3v2, stating that it is a poor standard and can result in corrupted files.  I can only assume Case subscribed to this thinking.

I for one would like to hear Case's story more.  He was posting infrequently when I joined the forum, and seems not to post at all now (hopefully the two events were no related).  On checking he was last active two days ago, but hasn't posted for six months.
Title: Changes Made to TAG.EXE
Post by: lossman on 2006-01-20 09:18:28
Is there any way to pipe the output to a text file? Im just trying to read the artist, album and genre tags into my vb app. I could use metaflac but would rather keep tag as its such a versatile tool.

Whenever I do
tag "1.flac"  --hideinfo --simple --hidenames >> test.txt

I get a blank text file
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2006-01-20 09:28:41
TAG.EXE --stdout *.* > report.txt

You will need at least version 2.0.44 (http://www.synthetic-soul.co.uk/tag/) to use the --stdout switch.
Title: Changes Made to TAG.EXE
Post by: hawkeye_p on 2006-01-20 09:35:57
use the --nfo switch!

Edit: Ooops Synthetic_Soul was quicker. However, --nfo works with earlier versions.
Title: Changes Made to TAG.EXE
Post by: lossman on 2006-01-20 10:02:21
Thanks guys, cant believe i missed that one!

Edit:

tag "1.flac"  --hideinfo --simple --hidenames --stdout >> rep.txt

worked perfectly.
Title: Changes Made to TAG.EXE
Post by: audiophiler on 2006-03-26 07:40:08
...i hope for an id3v2 writing support....
... if i'm just a good programmer, i can contibute to synthetic soul.
Title: Changes Made to TAG.EXE
Post by: cyborg on 2006-03-26 11:30:12
Tag.exe doesn't seem to be able to read ID3v2 tags written with foobar2000 0.9. Can you fix that Synthetic Soul?
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2006-03-26 12:03:38
Sorry, no.  I just don't have the knowledge of ID3v2 or C++.

Perhaps it is time that a competent C++ programmer took on the mantle?
Title: Changes Made to TAG.EXE
Post by: odyssey on 2006-04-12 12:27:24
Damn, I really hoped tag.exe could write ID3v2!!

I use Helium as tag manager, which reads APEv2 tags, but are appearent not very good at it. If I remove ID3v2 tags and update the "year"-tag, nothing shows up in Helium. I need this to update series of files with a script gathering data from a database.... so now i'm stuck :-(
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2006-10-31 03:08:35
I have a small feature request. Since foobar2000 started to write tracknumber field in format MM/NN where MM is track number and NN is total tracks count, it is hard to rename tracks using tag. Is it possible to strip '/' and everything after this char from tracknumber field when renaming?
Title: Changes Made to TAG.EXE
Post by: dv1989 on 2006-10-31 09:45:45
Try loading all of the MP3s whose tags you want to alter into foobar2000, selecting them and removing the TOTALTRACKS field. I have no idea how you could do this with TAG or another program, though.
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2006-10-31 10:58:22
Try loading all of the MP3s whose tags you want to alter into foobar2000, selecting them and removing the TOTALTRACKS field. I have no idea how you could do this with TAG or another program, though.

Do you feel the difference between correcting Tag's functionality and modifing tag information to let Tag work as expected?  I need this field, I don't want to remove it.
Title: Changes Made to TAG.EXE
Post by: odyssey on 2006-10-31 15:45:33
Try loading all of the MP3s whose tags you want to alter into foobar2000, selecting them and removing the TOTALTRACKS field. I have no idea how you could do this with TAG or another program, though.

HMM does it pretty much the same way... (Oh and by the way - It actually supports most of the ID3v2 standard which fb2k doesn't )
Title: Changes Made to TAG.EXE
Post by: urak on 2006-10-31 16:03:53
HMM does it pretty much the same way... (Oh and by the way - It actually supports most of the ID3v2 standard which fb2k doesn't )


Sorry, what's "HMM"?

thanks
Title: Changes Made to TAG.EXE
Post by: rjamorim on 2007-03-01 02:57:30
Damn, I really hoped tag.exe could write ID3v2!!


Me too. I understand that this subject is pretty much taboo here, but tag would be so much more useful to me if it just dropped the politics and wrote ID3v2 tags...
Title: Changes Made to TAG.EXE
Post by: Daijoubu on 2007-03-12 08:00:30
I've got those ID3v2 tag that iTune produce with the cover and it crash when applying it to a ogg file
Title: Changes Made to TAG.EXE
Post by: Andavari on 2007-03-12 11:01:14
Damn, I really hoped tag.exe could write ID3v2!!


Me too. I understand that this subject is pretty much taboo here, but tag would be so much more useful to me if it just dropped the politics and wrote ID3v2 tags...

I agree as well, and have wanted that feature implemented since the get go and the likes of Winamp and Foobar2000 can write them so I don't see why it was never implemented regardless of "taboo, and paranoia."
Title: Changes Made to TAG.EXE
Post by: fairway on 2007-04-24 18:41:39
Hello

Is there a reason that tag.exe does not create an extended m3u file for TAK files? I tested it with tag.exe --playlist *.tag but it did not creat an extended m3u playlist with the artist / title names.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-02 07:42:43
I'm not familiar with M3U playlists, or Tag's --playlist switch, but I used:

Code: [Select]
TAG --playlist *.mp3

... and created:

Code: [Select]
#EXTM3U
#EXTART:Lali Puna
#EXTALB:Tridecoder
#EXTINF:309,Lali Puna - 603
01 - 6-0-3.mp3
#EXTINF:237,Lali Puna - Rapariga da Banheira
02 - rapariga da banheira.mp3
#EXTINF:273,Lali Puna - Antena Trash
03 - antena trash.mp3
#EXTINF:214,Lali Puna - System On
04 - system on.mp3
#EXTINF:283,Lali Puna - Everywhere & Allover
05 - everywhere and allover.mp3
#EXTINF:279,Lali Puna - Tocadisco's
06 - toca-discos.mp3
#EXTINF:149,Lali Puna - Press My Tummy
07 - press my tummy.mp3
#EXTINF:235,Lali Puna - Fast Forward
08 - fast forward.mp3
#EXTINF:266,Lali Puna - Superlotado
09 - superlotado.mp3
Title: Changes Made to TAG.EXE
Post by: fairway on 2007-05-02 07:48:26
I'm not familiar with M3U playlists, or Tag's --playlist switch, but I used:

Code: [Select]
TAG --playlist *.mp3

... and created:

Code: [Select]
#EXTM3U
#EXTART:Lali Puna
#EXTALB:Tridecoder
#EXTINF:309,Lali Puna - 603
01 - 6-0-3.mp3
#EXTINF:237,Lali Puna - Rapariga da Banheira
02 - rapariga da banheira.mp3
#EXTINF:273,Lali Puna - Antena Trash
03 - antena trash.mp3
#EXTINF:214,Lali Puna - System On
04 - system on.mp3
#EXTINF:283,Lali Puna - Everywhere & Allover
05 - everywhere and allover.mp3
#EXTINF:279,Lali Puna - Tocadisco's
06 - toca-discos.mp3
#EXTINF:149,Lali Puna - Press My Tummy
07 - press my tummy.mp3
#EXTINF:235,Lali Puna - Fast Forward
08 - fast forward.mp3
#EXTINF:266,Lali Puna - Superlotado
09 - superlotado.mp3


did you try with tak files?
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-02 08:22:15
Just tried.  I got the header (below), but not any track info.  I'll try to take a look.

Code: [Select]
#EXTM3U
#EXTART:Lali Puna
#EXTALB:Tridecoder
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-02 09:20:42
Thinking about it, I think this will be because Tag understands MP3 files, but has no idea how to decypher TAK files (or OptimFrog, WavPack, and maybe more).  Part of the extended information involves writing the duration of the track, and Tag can't retrieve that as it doesn't know how to read the header.

That said, I believe using -1 for the duration is valid (certainly for streaming files), so I may see if I can get Tag to use -1 for the duration if it can't decypher the format, and use the meta data info that it should surely know about.

I'll add it to my list of crap to stop me from doing proper work... 

Edit: FYI I have confirmed this.  If Tag cannot obtain a duration it does not write the line at all.  I'll report back here if I can make the change.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-02 20:09:52
OK, you can give Tag 2.0.52 (http://www.synthetic-soul.co.uk/tag/) a go.

This version should write #EXTINF for any file.  If it doesn't understand the file type it will use -1 as the duration.

Edit: Removed beta status.
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-05 22:59:27
I use tag.exe to write the correct tags based on filenames with:

Code: [Select]
tag --auto --chreplace *.flac


I have changed the configuration file to mij needs (see below).
The autorenaming from ^ to ? works correct.
But somehow the conversion from ; to : doesn's work.
Must the ; be escaped or something?

Code: [Select]
# Specify character replacement for tagging
# note: space is separator
[CharReplacementForTag]
^ ?
; :
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-06 13:24:15
I can confirm that this is the case, but can't immediately see why.

FYI: prefixing the semicolon works, so a replacement of "@; :" will convert "@;" to ":"; however ";@ :" does not work as expected.

It seems to be an issue with it beginning with ";".  The ListSeparator is "; ", but I've checked in a hex editor and "^;^" results in 3F 3B 3F ("?;?"), not 3F 00 3F, as you would hope.

Dunno...

Here's the key code (taken from Tag.cpp) I believe (NB: swap is done in misc.cpp's ReplaceCharactersForTag):

Code: [Select]
case MCharReplaceTag:   // settings under [CharReplacementForTag]
    if ( (ReplaceTag->OldChars = (char **)realloc ( ReplaceTag->OldChars, sizeof (*ReplaceTag->OldChars) * (ReplaceTag->CharCount + 1) )) == NULL ) {
    fprintf ( stderr, "load_config: Memory allocation failed.\n" );
    exit (1);
    }
    if ( (ReplaceTag->NewChars = (char *)realloc ( ReplaceTag->NewChars, ReplaceTag->CharCount + 1 )) == NULL ) {
    fprintf ( stderr, "load_config: Memory allocation failed.\n" );
    exit (1);
    }
    p = temp;
    while ( *p && *p != ' ' ) p++;
    if ( (ReplaceTag->OldChars[ReplaceTag->CharCount] = (char *)malloc ( p - temp + 1 )) == NULL ) {
    fprintf ( stderr, "load_config: Memory allocation failed.\n" );
    exit (1);
    }
    if ( p > temp ) {
    strncpy ( ReplaceTag->OldChars[ReplaceTag->CharCount], temp, p-temp );
    }
    ReplaceTag->OldChars[ReplaceTag->CharCount][p-temp] = '\0';
    if ( *p == ' ' ) p++;
    ReplaceTag->NewChars[ReplaceTag->CharCount] = *p;
    ReplaceTag->CharCount++;
    break;
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-06 18:38:56
Doh.

Just seen the real culprit just before that code in Tag.cpp:

Code: [Select]
    while ( fgets_clean ( temp, sizeof (temp), fp ) != EOF ) {
        if ( temp[0] == '\0' || temp[0] == ';' || temp[0] == '#' )  // skip empty lines and comments
            continue;

Not sure how to resolve this.  It's possible to remove the check for ";", but what if people are using them for comment lines?  I don't like to break backward compatibility.  presumably "# :" wouldn't work either.

I can see no way to escape the character.
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-06 22:06:24
Thanks for the clear explanation.

I understand that you don't wont to break backwards compatibility.
A switch to disable the ; comment could be an option.
But maybe I'm the only one who really needed this feature.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-07 06:48:56
Well, users should really be able to swap any characters they choose.

I'd be tempted to stop ";" being a comment character just in that section. 1.  The initial cfg file uses "#" so users may only think (as I did) that "#" is the only character that can be used (so no-one is using ";"). 2. "#" does not need replacing, as it is a valid filename character, so that can still be used.

If you agree I can easily create 2.0.53b1 and upload for you (and all new full releases will act in this way).
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-07 08:13:07
If I understood correctly than the ; will still be a comment tag.
But only in the [CharReplacementForTag] section you can use ;

That is really a good solution and still backwards compatible.
So I agree and would like doing some tests with the upcoming tag 2.0.53b1

Thanks for your help.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-07 09:34:53
You understand correctly. You can try 2.0.53b1 (http://www.synthetic-soul.co.uk/files/tag_2.0.53b1.zip).

FYI: all I have amended is:

Code: [Select]
if ( temp[0] == '\0' || (temp[0] == ';' && mode != MCharReplaceTag) || temp[0] == '#' )  // skip empty lines and comments
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-07 10:20:10
Simply fixes are mostly the best 
Everything seems to work as expected.

If I find something strange I will post it here.
I don't think that will happen with such a straightforward fix.

Thanks again.
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-11 15:33:12
I have done some test the last days with tag 2.0.53b1 and everything related to the ; renaming worked perfectly.

With double albums I discovered that tag.exe gave the album tag a cd number like below:

Code: [Select]
Filename                      Album tag
101 - Album name.extension    Album name (CD 1)
102 - Album name.extension    Album name (CD 1)
201 - Album name.extension    Album name (CD 2)
202 - Album name.extension    Album name (CD 2)


Can this behaviour somehow be configured or is this hard coded in the program?
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-11 17:08:24
It looks to me as though there is a way to get the value into a Disc tag instead, but I can't work out how. 

The relevant code is in "guess.cpp".

FYI, according to the code %D for Disc is a valid token, although it's not documented in the CFG file.

I can't work out from the code what you're supposed to do to get the disc tag instead of it appending " (CD x)" to the album name.

Edit:  Got it. I don't know what I was doing wrong.

Code: [Select]
tag --auto --scheme "%L\%D%N - %T" "204 - Track name.wv"

Code: [Select]
Tag - Automatic Tag from filename
Copyright (c) 2002-2003 Case.  Minor additions by Neil Popham, 2004-2007
Version 2.0.53b1, Compiled 2007-05-07

C:\Documents and Settings\Neil\Desktop\204 - Track name.wv
Tag:     Generated from name
Title:   Track name
Artist:
Album:   Desktop
Year:
Track:   04
Genre:
Comment:
Disc=2
APE v2.0 tag written.
Title: Changes Made to TAG.EXE
Post by: WaldoMonster on 2007-05-11 19:10:40
I don't want to be a pain in the arse 
But still I found a problem with tag.

Code: [Select]
tag --auto --chreplace --scheme "%A\%Y - %L\%D%N - %T" *.flac

When using the command line like this the "Vorbis comment" block is written as below:

Code: [Select]
METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 316
  vendor string: reference libFLAC 1.1.4 20070213
  comments: 11
    comment[0]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
    comment[1]: REPLAYGAIN_TRACK_GAIN=-6.36 dB
    comment[2]: REPLAYGAIN_TRACK_PEAK=0.98138428
    comment[3]: REPLAYGAIN_ALBUM_GAIN=-6.48 dB
    comment[4]: REPLAYGAIN_ALBUM_PEAK=0.98852539
    comment[5]: Disc=2
    comment[6]: TITLE=Hatoa
    comment[7]: ARTIST=Bonobo
    comment[8]: ALBUM=Days to come
    comment[9]: TRACKNUMBER=07
    comment[10]: DATE=2006
METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 3820


The %D is written as "Disc", I think that this must be "DISCNUMBER" for "Vorbis comment".
When using the same line "%A\%Y - %L\%D%N - %T" in the [Schemes] section of tag.cfg it doesn't work at all.
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2007-05-11 19:36:20
I have a feature request. Tag currently doesn't work properly with tracknumbers like "01/19" when renaming. It just renames file to "01-19 (something)". It would be better if it would rename file to "01 (something)" in this case.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-11 21:48:33
The %D is written as "Disc", I think that this must be "DISCNUMBER" for "Vorbis comment".
When using the same line "%A\%Y - %L\%D%N - %T" in the [Schemes] section of tag.cfg it doesn't work at all.
I can easily (I think) change it to write Discnumber for all formats.  I'm tempted by this, as IIRC it is the suggested filed name for that data.  I'm confused why foobar uses Disc now, when I thought that it had previously moved from Disc to Discnumber.

The code that creates the disc tag has the comment "// quick hack".  I'm not confident about copying this to the other functions, that deal with the schemes and auto tagging.

I have a feature request. Tag currently doesn't work properly with tracknumbers like "01/19" when renaming. It just renames file to "01-19 (something)". It would be better if it would rename file to "01 (something)" in this case.
I'm sorry, but this is beyond me.
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2007-05-12 00:59:03
I'm sorry, but this is beyond me.

Ok, can you please try this patch? I was unable to build all this mess because of libFLAC.

Code: [Select]
--- guess-old.cpp    2005-06-12 20:37:10.000000000 +0400
+++ guess.cpp    2007-05-12 03:11:51.981339500 +0400
@@ -678,6 +678,7 @@
     char    temp    [_MAX_PATH * 2 + 1];
     char    tempname[4096];
     char*   src   = NULL;
+    char*   sl;
     char*   f;
     size_t  s_pos = 0;
     size_t  i;
@@ -713,8 +714,14 @@
         }

         if ( src != NULL ) {
-            if ( src == TagValue ( APE_TAG_FIELD_TRACK, Info ) && (strlen (src) == 1) ) {
-                *f++ = '0';
+            if ( src == TagValue ( APE_TAG_FIELD_TRACK, Info ) ) {
+                if (strlen (src) == 1) {
+                    *f++ = '0';
+                }
+                sl = strchr ( src, '/' );
+                if ( sl != NULL ) {
+                  strncpy ( sl, '\0', 1 );
+                }
             }

             f += sprintf ( f, "%s", src );
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-12 08:23:50
Ok, can you please try this patch? I was unable to build all this mess because of libFLAC.
Your patch causes an application error.

NB: I have written a guide regarding how to set up the source structure to build Tag.  I did this ages ago, as it took me so long to just work out how to compile it when I made my first changes; it may be obvious to you.  The guide can be found here:

http://www.synthetic-soul.co.uk/tag/setup.txt (http://www.synthetic-soul.co.uk/tag/setup.txt)

It seems pretty f***ed up that you, as a C programmer, should be asking me, a non-C programmer, to make changes.  If you know C and want changes, do it!

As I've said many times now, I find my lack of knowledge frustrating, and trying to action people's requests is now just pissing me off.  I wish I'd stopped at version 2.0.40 sometimes.  I rarely even use Tag, although I do find it very useful to check what foobar is up to.

Sorry, don't mean to rant, and it's not aimed at you specifically.

Edit: Hang on, now I bother to look at your code, you never end up doing anything with sl do you?
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2007-05-12 13:08:33
Your patch causes an application error.

Oops...

Quote
It seems pretty f***ed up that you, as a C programmer, should be asking me, a non-C programmer, to make changes.  If you know C and want changes, do it!

I'm not a C programmer. In fact, I don't know C at all. I just analized the code and made a change that could do the thing in theory. But I could mess up something with pointers because I don't know how they work in C.

I will try your guide, maybe it'll help me to find those missing headers libFLAC wants.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-12 13:19:02
I'm not a C programmer. In fact, I don't know C at all. I just analized the code and made a change that could do the thing in theory. But I could mess up something with pointers because I don't know how they work in C.
Ah, I see.  Seems like we are in the same boat.
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2007-05-12 15:03:12
Your patch causes an application error.

I found why. Replace
Code: [Select]
+                  strncpy ( sl, '\0', 1 );

with
Code: [Select]
+                  strncpy ( sl, "\0", 1 );


How could I do such a stupid mistake?

PS: I spent an hour trying to build it with VS2003, but ended up with nothing. Everything builds but linker shows errors. So, it's again an unverified patch.. Hope it'll work this time..
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-05-12 16:01:39
That appears to work.

Shouldn't it still pad the number though?


Edit: S'OK, I just changed it to:

Code: [Select]
if ( src == TagValue ( APE_TAG_FIELD_TRACK, Info ) ) {
    sl = strchr ( src, '/' );
    if ( sl != NULL ) {
        strncpy ( sl, "\0", 1 );
    }
    if (strlen (src) == 1) {
        *f++ = '0';
    }
}


2.0.53b2 (http://www.synthetic-soul.co.uk/files/tag_2.0.53b2.zip)
Title: Changes Made to TAG.EXE
Post by: vasya_pupkin on 2007-05-12 17:57:30
Thank you very much! It works!
Title: Changes Made to TAG.EXE
Post by: odyssey on 2007-10-31 17:13:23
Ummm, is it possible to avoid printing the copyright notice? Currently it outputs to the screen no matter what.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-10-31 20:03:42
I don't think that you can, but I don't think that you need to.  You may want to look at --stdout.

Using that switch you can output the important bits to STDOUT, and leave the header writing to STDERR (IIRC).

E.g.:

Code: [Select]
TAG.EXE --stdout --hideinfo --hidenames file.mp3 > tags.txt
Title: Changes Made to TAG.EXE
Post by: A1S on 2007-11-26 13:23:27
Thanks for the tool. Will not prompt, how I can write a cover in a wv-file? Whether it is possible to register separate tags (for example Cover Art (Front) and Cover Art (Back))?
Title: Changes Made to TAG.EXE
Post by: odyssey on 2007-11-26 15:04:52
I don't think that you can, but I don't think that you need to.  You may want to look at --stdout.

Using that switch you can output the important bits to STDOUT, and leave the header writing to STDERR (IIRC).

E.g.:

Code: [Select]
TAG.EXE --stdout --hideinfo --hidenames file.mp3 > tags.txt


I figured that was the only way I could direct the output to a textfile, but it's still being displayed on the screen (it usually should not when the output is directed).

It's just a nice-to-have feature, but I created a backup-script that would save all tags to dummy-files, and it would be nice if I could disable output to the screen (while directing the output to a file using pipes, like default commandline applications act), to simplify the process window.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-11-26 16:38:12
Ummm, is it possible to avoid printing the copyright notice? Currently it outputs to the screen no matter what.
No, AFAIK.

Thanks for the tool. Will not prompt, how I can write a cover in a wv-file? Whether it is possible to register separate tags (for example Cover Art (Front) and Cover Art (Back))?
You cannot write binary tags, AFAIK.
Title: Changes Made to TAG.EXE
Post by: A1S on 2007-11-26 17:52:28
Thanks for the tool. Will not prompt, how I can write a cover in a wv-file? Whether it is possible to register separate tags (for example Cover Art (Front) and Cover Art (Back))?
You cannot write binary tags, AFAIK.

There is no possibility to make such option? Very-very big request. In foobar2000 0.9.5 there was a support Embedded album art.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-11-26 18:27:37
There is every possibility, but very little probability.

It is something that I would like to see in Tag, but I don't think that I have the time or skill to implement it.
Title: Changes Made to TAG.EXE
Post by: A1S on 2007-11-26 23:28:23
But can all the same it will be possible?  We by means of a script, using tag.exe and ImgBurn.exe, do a backup copy of audio-disk with all tags (cuesheet,logfile,genre,discid...) in a format wv.iso.wv (process completely automatic). The only thing of that does not suffice is tag Cover Art.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-11-27 09:27:21
It is obviously possible for an accomplished C(++) programmer to add binary tag support to Tag; if MP3Tag can do it then there is no logical reason why another application cannot.

This post (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=40603&view=findpost&p=504669) documents the format that MP3Tag uses.
Title: Changes Made to TAG.EXE
Post by: ntan01 on 2007-12-03 20:43:00
I am having a technical problem with tag.exe.

My question involves the --allow switch on the command line. I have an automated process that records mp3's and dumps them in various directories based on a criteria setup in the recording process. I want to use tag.exe to pull information from the file path and insert it into the tags. I've gotten this much to work just fine.
My problem is that mp3's are constantly being recorded and added to the directories. I would like to schedule a task to run tag every X minutes that crawls the directories and only processes those files that do not have tag information yet. (basically anything added since the last time tag was ran)
I'm assuming that I use --allow to accomplish this, but I'm not sure how to represent a null value. --allow "album=" doesn't seem to do the trick.

Any suggestions?
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-12-05 19:57:46
--allow will check for an exact match, and that's all.  I'm not sure that it is any use to you.

I  don't know what scripting language you are using, but I would probably look to using Tag's --tostdoutn switch,  to output the value of a specific tag to STDOUT - checking to see whether the value was empty or not and acting accordingly.

Here is a simple DOS example, that will check for the existence of the Artist tag in all MP3s in a directory, and its subdirectories:

Code: [Select]
@ECHO OFF

FOR /R %1 %%G IN (*.mp3) DO CALL :CheckArtist "%%G"

PAUSE

GOTO :EOF

:CheckArtist
    CALL :GetTag Artist %1
    IF [] EQU [%Artist%] ECHO %1 has no Artist field.
GOTO :EOF

:GetTag
    TAG.EXE --tostdoutn %1 --hideinfo --hidetags --hidenames %2>"%TEMP%\tmp.txt"
    SET /P %1=<"%TEMP%\tmp.txt"
    DEL "%TEMP%\tmp.txt"
GOTO :EOF

(Save as a BAT file and drag the root folder onto the icon to test - or pass the folder path as a parameter on the command line.)
Title: Changes Made to TAG.EXE
Post by: ntan01 on 2007-12-06 16:02:52
Thanks. When I drag and drop, it works fine, but I'm having troubles getting it to run from the command line.

This is probably a total noob question, but how do I get this to work from the command line. I tried:
foo.bat c:\mp3\
and that didn't work. But if I drag the mp3 folder to the foo.bat, it works fine.

What am I doing wrong?

Thanks,
-Nate
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2007-12-06 16:13:01
It may be to do with the path to Tag.

Try changing the line that calls Tag to use the full path - or ensure that Tag is in a folder in your PATH (like your Windows folder).

That's all I can think of - it works fine for me either way (I have Tag in my Windows directory).
Title: Changes Made to TAG.EXE
Post by: odyssey on 2008-05-25 23:14:32
Is it impossible to remove all tags from a file, while tagging specific fields?

I would expect using --remove with -t item=x would erase all existing fields and only leave the specified, but it seem to disregard the --remove parameter.
Title: Changes Made to TAG.EXE
Post by: Paul Burger on 2008-08-05 13:14:32
Hi Synthetic Soul,

First of all, thanks for keeping TAG alive and all the work you did on REACT2!

I can get Tag to create a playlist using the REACT2. (as per the wiki post).

My idea behind creating playlists is to create a "playlist" directory for each compression type in the parent directory of the specific compression type.

For example;
..\Music\MP3\Playlists\ > contains all mp3 playlists and
..\Music\MP3\ > contains all the album directories

These playlists should therefore reference ..\"Artist - Album [Year]"\"TrackNo. TrackName".mp3. That is if I understand playlists correctly.

The idea is to copy the entire directory (e.g. MP3, Ogg or Flac) to whatever player I'm using, so when I want to play anything I simply browse the playlist directory to find the appropriate (custom or album) playlist.

I tried to get this done with Tag but it does not seem to support directory references.

If this cannot be done in Tag, can you possibly recommend something else?

Thanks
Paul
Title: Changes Made to TAG.EXE
Post by: noorotic on 2008-08-05 16:10:36
Synthetic Soul, I had not checked this thread in a long time.  If it is needed, I have the C code for importing and exporting binary (images) into APEv2 tags.    I am not sure I know the Tag code well enough to insert into it however.  Also, it would create a feature for APE not supplied by Tag for other tag types.

I personally do not care much for the embedding of artwork, for myself.  It seemed like a fun thing to do.  I have wondered why, since all tag formats provide for URL, and having followed the thread on artwork in the Foobar forum a bit, it would not be best simply to set the URL bit and allow people to point the player to the local file they want.  Seems much more efficient.

However since most of Tag is C (I haven't picked up C++ yet) I think my import/export functions should work if integrated into Tag's code.

I'll check back some time. thx
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2008-08-05 16:46:23
I tried to get this done with Tag but it does not seem to support directory references.

If this cannot be done in Tag, can you possibly recommend something else?
No, it doesn't look like it does.

I guess that you could just use ECHO commands in your config to append to a playlist, e.g.:

Code: [Select]
ECHO $cdartist$ - $album$ [$date$]\$track$ - $title$.mp3>>@OutRoot@\Music\MP3\Playlists\$cdartist$ - $album$.m3u

You may have to escape some characters though, otherwise ampersands (for example) will cause problems.  Certainly a possibility though.

Synthetic Soul, I had not checked this thread in a long time. If it is needed, I have the C code for importing and exporting binary (images) into APEv2 tags. I am not sure I know the Tag code well enough to insert into it however. Also, it would create a feature for APE not supplied by Tag for other tag types.
I would like to see support for embedding images in Tag; however, as you say, it would be wrong to add it for APEv2 only.  Also, I'm not sure that I would have the where-with-all (or inclination) to insert the code.  Thanks for the thought though. I must admit that I have lost an interest in doing anything else with Tag.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2008-08-07 13:11:46
Off-topic posts regarding REACT moved to a new thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=65153).
Title: Changes Made to TAG.EXE
Post by: Lurkas on 2008-08-07 13:47:57
TAG doesn't write ID3v2.3 tags. The source is out there, have anyone seen a build capable of writing those tags?

I wish someone could implement it..
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2008-08-07 13:49:40
Would metamp3 (search this board) be of any use?
Title: Changes Made to TAG.EXE
Post by: Lurkas on 2008-08-07 14:26:31
Thanks for the notification but I had a look at it last night. It doesn't look like it has the character replace function and tags from file name.
Title: Changes Made to TAG.EXE
Post by: greynol on 2008-08-07 15:49:25
TAG doesn't write ID3v2.3 tags.

I'm using tag.exe with Lame and am getting ID3v2 tags with no trouble at all.
Title: Changes Made to TAG.EXE
Post by: Lurkas on 2008-08-07 16:16:26
That sounds interesting. Can someone please explain how to do that?
Title: Changes Made to TAG.EXE
Post by: greynol on 2008-08-07 16:25:55
Code: [Select]
tag %1 2> "%~1.tag"
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Title:" "%~1.tag"`) DO (
  SET title=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Artist:" "%~1.tag"`) DO (
  SET artist=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Album:" "%~1.tag"`) DO (
  SET album=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Year:" "%~1.tag"`) DO (
  SET year=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Track:" "%~1.tag"`) DO (
  SET track=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Genre:" "%~1.tag"`) DO (
  SET genre=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Comment:" "%~1.tag"`) DO (
  SET comment=%%Y
)
SET TAGINFO=--add-id3v2 --tt "%title%" --ta "%artist%" --tl "%album%" --ty "%year%" --tn "%track%" --tg "%genre%" --tc "%comment%"
DEL "%~1.tag"
Title: Changes Made to TAG.EXE
Post by: Lurkas on 2008-08-07 17:59:33
Thank you for your reply greynol. I assume that's a batch script. I'm not really sure on how to use that. Can you please give a verbose example on how to use it in a commandline?
Title: Changes Made to TAG.EXE
Post by: greynol on 2008-08-07 18:19:04
It's a subroutine to be used in a batch script, though you can use it as a separate script.  You call the routine and pass it the name and path of the source file.  It will then generate a variable called TAGINFO which you would use in your Lame command line.

Example assuming this is a separate script called id3v2tag.bat and a source file called c:\stuff\source.flac

id3v2tag c:\stuff\source.flac

let's assume you have created source.wav (though I don't do it this way)

lame -V5 %TAGINFO% c:\stuff\source.wav c:\stuff\source.mp3

EDIT: Here's an example of a similar routine put to use in a script to encode using neroAacEnc:
http://www.hydrogenaudio.org/forums/index....st&p=580029 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=65020&view=findpost&p=580029)
Title: Changes Made to TAG.EXE
Post by: Lurkas on 2008-08-11 20:30:47
Can I get this to work with wildcards, and what syntax to use if so?

Is it possible to just tag an encoded file with lame.exe? I've only pulled it off while encoding..
Title: Changes Made to TAG.EXE
Post by: greynol on 2008-08-11 20:45:49
>Can I get this to work with wildcards, and what syntax to use if so?
You can't pass a wildcard to the script as it currently exists.

>Is it possible to just tag an encoded file with lame.exe?
No.

Please, no more questions about batch scripts.  Let's keep this discussion on topic.  Synthetic Soul has had to split this thread once already.
Title: Changes Made to TAG.EXE
Post by: Illustrations on 2008-10-01 16:04:04
My Review of Tag 2.0.52

I have been using computers since before the DOS days.  I am very familiar with DOS.  Yet, because the documentation of Tag.EXE was incomplete and inaccurate, it took me FOUR HOURS TO FIGURE THE THING OUT.  I almost gave up.  It would've been faster to just copy and paste into the ID3's.

The Tag.TXT text file shows an example ID3 insertion SCHEME as A - N - T, but it does not show the entire example command line.  I tried numerous times, even going to the author's, "Synthetic Soul", forum he frequents:  Hydrogenaudio Forums.  If you use a free email address to sign up, you can't even post for FIVE DAYS!  Left on my own, I finally figured out the SCHEME I wanted has the following correct syntax:
Tag --auto --scheme "X-A - T" *.mp3

Notice the quotes.  Tag.TXT also contradicts itself when using slashes for SCHEME.  At the top it shows a backslash and at the bottom, for options, it shows a forward slash.  Although "-t <item=x>", "-f <item=x>" and "--fromfile <file>" are mentioned under options, I have no clue how to actually implement them.  WHAT is "item=x"?  How exactly do you use a text file and how do you match its lines up with the MP3 file ID3 info you're trying to change?  The Tag.TXT file needs more complete examples with correct syntax.

While the program appears to work correctly, because of very poor documentation, its potential will never be fully realized.  I recommend to Synthetic Soul that he correct and add to the included Tag.TXT file.  Also, for SCHEME, I recommend a more robust implementation of the "X" option (text to be disregarded).  I wanted to disregard the first 3 numerical digits of each MP3 which are followed by a {space}.  Unfortunately, Tag.EXE can't do this.  A DOS-type wildcard convention would help using "?"'s or maybe using "X" as single characters when there are more than one as in "XXX".

Reviewed at Softpedia Tag 2.0.43 user reviews (http://www.softpedia.com/progViewOpinions/Tag-21935,.html)
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2008-10-01 16:20:44
Title: Changes Made to TAG.EXE
Post by: Illustrations on 2008-10-01 17:42:54
Synthetic Soul,

{out}
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2008-10-01 18:12:41
Your understanding of Tag probably exceeds mine.  I only used Tag for basic operations, mainly tagging from file.  Given that I only wrote 1% of the code, I am no expert on the other 99%.
Title: Changes Made to TAG.EXE
Post by: gottkaiser on 2010-01-18 03:52:59
Hello Synthetic Soul,

I tried copying the tags from one flac file to another flac file.
I used this batch line:
Code: [Select]
"file-path\Tag.exe" --fromfile "file-path\name.flac" "file-path\name.lossy.flac"

Tag.exe accepts the line but is crashing during processing.
One flac file is processed with lossyWAV.exe. (original.flac and lossy.flac)
I tried copying the tags from the original to the lossy.flac file.
If you'd like I could provide them for you. (they are quite small)


Any help would be appreciated. (even referral to another method)
Title: Changes Made to TAG.EXE
Post by: hawkeye_p on 2010-01-18 08:28:33
What do you mean with "crashes"?

Does the tag.exe process hang or vanish?

The first could come from tag.exe choking on the LYRICS tag.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 09:19:31
IIRC --fromfile is actually used to tag from a text file containing the tag information.

I'm afraid I can't be any more help than that.  I don't think that it is possible with Tag with one command line.  You could possibly use the ability to write a tag's content to file (--tostdoutn) in conjunction with the ability to tag using the contents of a file (-f); however that would require two commands per tag, and there has to be an easier way.

Personally, I'd use foobar for this.
Title: Changes Made to TAG.EXE
Post by: hawkeye_p on 2010-01-18 09:39:13
That's not correct, Neil: --fromfile indeed copies the tag information from a tagged file.
Nevertheless I'd also use foobar for this task (in the meantime, as you know  )
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 09:48:38
 Just goes to show that I don't use Tag much.  Not sure where I got that idea, but I was quite confident about it!

I'm sorry, but there isn't a hope in Hell of me fixing this.  I don't have the skillz.

Edit: Ha! Scroll up to post #102 (mainly .5)...  I knew there was general confusion on the switch, but thought it was the other way around...
Title: Changes Made to TAG.EXE
Post by: hawkeye_p on 2010-01-18 10:01:30
I might have, but I prefer spending my time with other things. 

If gottkaiser indeed has the problem with tag .exe, my workaround will help:

- export lyrics from source file to temp file
- remove lyrics from source file
- copy tags
- add lyrics to both files

You also might find the foobar solution easier ...
Title: Changes Made to TAG.EXE
Post by: hawkeye_p on 2010-01-18 10:04:39
Edit: Ha! Scroll up to post #102...


Yes, that's embarrassing 
Title: Changes Made to TAG.EXE
Post by: gottkaiser on 2010-01-18 11:02:15
You could possibly use the ability to write a tag's content to file ([font= "Courier New"]--tostdoutn[/font]) in conjunction with the ability to tag using the contents of a file ([font= "Courier New"]-f[/font]); however that would require two commands per tag

I tried to put it together for one tag but failed. My knowledge about [font= "Courier New"]stdout[/font] and how to use it is not good enough.
Could you give an universal valid example for one tag?

Thanks for your help so far.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 12:39:06
Here is an example.

The following line will output the contents of the tag "mytagname" to STDOUT, and write that to a text file (tag.txt) in your temp directory:
Code: [Select]
tag --tostdoutn mytagname source.flac>%TMP%\tag.txt

The following line will then set the tag "mytagname" from the contents of the same text file:
Code: [Select]
tag -f "mytagname=%TMP%\tag.txt" destination.flac

It would probably be best to join these using &&, so that the second command will only fire if the first is successful.  Also, you could tidy up by deleting the temporary file.

This leaves us with:

Code: [Select]
TAG --tostdoutn mytagname source.flac>%TMP%\tag.txt && TAG -f "mytagname=%TMP%\tag.txt" destination.flac && DEL %TMP%\tag.txt

You would have to repeat this for every tag that you want to copy over. If you were doing this in a batch file you could ease your pain a little by using variables to replace the tag, source and destination values.

There has to be an easier way...
Title: Changes Made to TAG.EXE
Post by: gottkaiser on 2010-01-18 12:43:35
I came up with this lines to copy a tag from a "name.flac" to a "name.lossy.flac" file:
Code: [Select]
"%~dp0Tag.exe" --tostdoutn "REPLAYGAIN_ALBUM_GAIN" "%~dpn1.flac" >> "%~dp0tmp.txt"
set /p TOOLOUTPUT= < "%~dp0tmp.txt"
del "%~dp0tmp.txt"
"%~dp0Tag.exe" -u "REPLAYGAIN_ALBUM_GAIN=%TOOLOUTPUT%" "%~dpn1.lossy.flac"

This means at the moment I use a temporary text file.

Is there another more direct way without temporary file?

Edit:
I saw your answer to late :-) Big thanks to you!
If anybody has an idea for a direct (without temporary file) way it would please share it.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 12:48:38
I guess Tag would need to be able to tag from STDIN to be able to skip that phase, and I don't think that it can.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 12:53:16
How about this:

Code: [Select]
METAFLAC --export-tags-to=- source.flac | METAFLAC --import-tags-from=- destination.flac

Edit: Note that you may get duplicate tags if destination.flac is already tagged.  To be on the safe side maybe you could use:

Code: [Select]
METAFLAC --remove-all-tags destination.flac && METAFLAC --export-tags-to=- source.flac | METAFLAC --import-tags-from=- destination.flac
Title: Changes Made to TAG.EXE
Post by: gottkaiser on 2010-01-18 13:27:55
Big big thanks!
the metaflac method was what I searched for.

Do you have an idea for copying the picture tag?
I tried:
Code: [Select]
METAFLAC --no-utf8-convert --export-picture-to=- source.flac | METAFLAC --no-utf8-convert --import-tags-from=- destination.flac

but its gives me an error .

I guess it has to do with the command "--import-tags-from" I' not sure about the proper specification (http://flac.sourceforge.net/documentation_tools_flac.html#flac_options_picture) for the picture.


Again thanks for your troubles.
Title: Changes Made to TAG.EXE
Post by: Synthetic Soul on 2010-01-18 14:04:49
It doesn't look like you can use STDIN with --import-picture-from.  It looks like you'd have to export to a file and import from there.

Code: [Select]
METAFLAC --remove-all-tags destination.flac && METAFLAC --export-tags-to=- --export-picture-to=temp.jpg source.flac | METAFLAC --import-tags-from=- --import-picture-from=temp.jpg destination.flac

I'm no expert with metaflac though (or Tag it seems!) so really your guess is as good as mine.
Title: Changes Made to TAG.EXE
Post by: gottkaiser on 2010-01-18 15:24:58
I'm no expert with metaflac though (or Tag it seems!) so really your guess is as good as mine.

Your line works. Now I can finish my personal batch project.   
Thanks very much! Again.
Title: Changes Made to TAG.EXE
Post by: Bjossi on 2010-04-03 06:07:06
I am making some batch scripts (one per album) that will auto-encode & tag files for me. Tag.exe will come in handy because some of these files have characters that command-line will turn into garbage when receiving them directly from a batch file. Well, that was what I hoped for before I ran into trouble. Wildcards work great for making Tag and the encoder read filenames with foreign characters, but the tagging is more tricky it seems.

Example of my usage: Tag --chreplace "Comment=Test =a x" C:\test.wv (=a will return " according to Tag.cfg). but the resulting tag will be Test =a x, not Test " x. Does the char replacing only work in automatic modes? If so, then does anyone know good alternate methods to get foreign characters into tags (and filenames also) from a batch script? Only method I found working is using -f and lead to a text file containing the tag value, but it seems awfully inconvenient to make hundreds of text files for my project as a whole. Would be great if I could specify which line to read from within a text file, like -f 14 "Title=C:\tag.txt".

Thanks in advance!
Title: Changes Made to TAG.EXE
Post by: muzack on 2010-06-11 14:55:32
hello, i've searched for hours for a commandline tagger or better ID3 Tag reading tool.
Tag.exe is the best but I think I need something impossible (because none of the tools I've found offer that)
Why is it not possible to print out Non Standard tags like <PUID> or stuff like that.
I set custom tagfields in foobar2000 with some additional info and I need to get these info over command line and write it into a textfile or something like that.
Is this generally possible?

thanks for any hint m.
Title: Changes Made to TAG.EXE
Post by: sirmax on 2011-04-22 13:36:56
I have made some improvements:

Version 2.0.53:
(+) Added M4A support for reading (alac.exe is required).
(-) Fixed Lyrics3 v2.0 writing.
(*) Reviewed ID3v2 code.

Win32 binaries and sources attached.
Title: Changes Made to TAG.EXE
Post by: selyb on 2011-04-30 04:23:46
if you or anyone else plans any more updates, I have a request: Show multiple tag info

my problem is if the audiophile has more than one type of tag (e.g. some.mp3 has id3v2.4+id3v1.1) then tag.exe picks the first one it recognizes and displays only the info from that tag
so, if id3v1 is complete and id3v2 is present but all blank, then tag.exe will display that it contains a tag but all blank entries

What I'm asking is that tag.exe instead shows all tag formats for each file e.g.
Code: [Select]
c:\my.mp3
Format:  MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 211 kbps, playtime 03:52
[ID3v2]
Title:   You Make Me Sick
Artist:  Egypt Central
Album:   Egypt Central
Year:    2008
Track:   2
Genre:   Rock
Comment:
ENCODEDBY=Exact Audio Copy   (Secure mode)
replaygain_album_gain=-10.43 dB
replaygain_album_peak=1.216547
replaygain_track_gain=-10.62 dB
replaygain_track_peak=1.195923
[ID3v1]
Title:   You Make Me Sick
Artist:  Egypt Central
Album:   Egypt Central
Year:    2008
Track:   2
Genre:   Rock
Comment:
[APE v2.0]
Title:   You Make Me Sick
Artist:  Egypt Central
Album:   Egypt Central
Year:    2008
Track:   2
Genre:   Rock
Comment:
ENCODEDBY=Exact Audio Copy   (Secure mode)
replaygain_album_gain=-10.43 dB
replaygain_album_peak=1.216547
replaygain_track_gain=-10.62 dB
replaygain_track_peak=1.195923
Title: Changes Made to TAG.EXE
Post by: semiflacco on 2012-02-21 00:55:25
Hi,

An issue and a question about the --paranoid option:

- I'm running tag.exe 2.0.52 and --help does not show the --paranoid option. I've been writing a script recently and opted to work around the lack of a return code because I thought it wasn't available and only stumbled on the option today when I noticed a reference to it in some release notes for an earlier version. Perhaps something has gone wrong with the code to display help?

- Can anyone please tell me what the return codes are? I've searched and can only find that (as expected) we get non-zero for errors or warnings, but no more detail than that. I've tested with a read-only file and find that it works (great!) and I get an errorlevel of 32 so I'm guessing there is some bitsetting going on, but would really like to distinguish between "Failed to write but no damage done", and "Ooops, just chewed up your file" so my script can respond appropriately.

Thanks in advance.
Title: Changes Made to TAG.EXE
Post by: TagUser on 2012-03-11 17:04:47
@sirmax and other developers:

Is there any chance, that we get id3v2 WRITE support?

From the --help we know:
Main features:
* Support for multiple standards:
  - ID3v1.x
  - ID3v2.x (reading and removing)
but I'm desperately looking for a possibility to WRITE id3v2-tags.
I would like to write all my metadata in id3v2.3, not only in id3v1.

And +1 for selyb's request to show multiple tags, especially the one's with different content.
Title: Changes Made to TAG.EXE
Post by: Stone Free on 2012-06-11 15:45:05
- Can anyone please tell me what the return codes are? I've searched and can only find that (as expected) we get non-zero for errors or warnings, but no more detail than that. I've tested with a read-only file and find that it works (great!) and I get an errorlevel of 32 so I'm guessing there is some bitsetting going on, but would really like to distinguish between "Failed to write but no damage done", and "Ooops, just chewed up your file" so my script can respond appropriately.
That sounds suspiciously like the return value of the windows function ShellExecute - http://msdn.microsoft.com/en-us/library/wi...3(v=vs.85).aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx)

In that case 32 indicates that the command was succesfull, see the return value section of the above link!

Numbers less than 32 indicate one of the windows Win32API error.
Title: Changes Made to TAG.EXE
Post by: CoRoNe on 2013-08-19 13:05:54
Hi there,

I have a question:
Code: [Select]
@ECHO OFF

SET pathToLame="D:\Binaries\lame (MP3 Encoder 3.99.5 using libsndfile 1.0.25, 29022013).exe"
SET pathToTag="D:\Binaries\tag (Tag 2.0.52, command line tagger).exe"

mkdir "%~dp1MUSIC_(mp3)"
:loop
IF "%~1"=="" GOTO end
%pathToLame% -V 5 --nohist --noreplaygain %1 "%~dp1MUSIC_(mp3)\%~n1.mp3" && %pathToTag% --hideinfo --hidetags --fromfile %1 "%~dp1MUSIC_(mp3)\%~n1.mp3"
SHIFT
GOTO loop
:end
PAUSE

While this batch script creates perfectly tagged mp3s in a sub-dir "MUSIC_(mp3)":
Code: [Select]
Tag - Automatic Tag from filename
Copyright (c) 2002-2003 Case.  Minor additions by Neil Popham, 2004-2007
Version 2.0.52, Compiled 2007-05-04

D:\Audio_samples\MUSIC_(flac)\MUSIC_(mp3)\sample-1.mp3
Lyrics3 v2.0 tag written.


Code: [Select]
@ECHO OFF

SET pathToLame="D:\Binaries\lame (MP3 Encoder 3.99.5 using libsndfile 1.0.25, 29022013).exe"
SET pathToTag="D:\Binaries\tag (Tag 2.0.52, command line tagger).exe"

mkdir "%~dp1..\MUSIC_(mp3)"
:loop
IF "%~1"=="" GOTO end
%pathToLame% -V 5 --nohist --noreplaygain %1 "%~dp1..\MUSIC_(mp3)\%~n1.mp3" && %pathToTag% --hideinfo --hidetags --fromfile %1 "%~dp1..\MUSIC_(mp3)\%~n1.mp3"
SHIFT
GOTO loop
:end
PAUSE
...this code does not.

Code: [Select]
Tag - Automatic Tag from filename
Copyright (c) 2002-2003 Case.  Minor additions by Neil Popham, 2004-2007
Version 2.0.52, Compiled 2007-05-04

D:\Audio_samples\MUSIC_(mp3)\sample-1.mp3
Failed to open file.
File time stamp modification failed.
Lame encodes the flac-file to mp3 into "MUSIC_(mp3)", which in this case is 1 directory higher than %~1. This all goes well, but Tag seems to have some difficulties.
Does anyone know what's going on?
Title: Changes Made to TAG.EXE
Post by: CoRoNe on 2013-08-21 20:00:57
I'm sorry Synthetic Soul, but now I can't reproduce the issue anymore , which is of course good news...so never mind. Mp3's in a parent directory now get properly tagged.
Title: Changes Made to TAG.EXE
Post by: moosehunter on 2014-01-20 10:23:28
I've noticed that when using --fromfile with FLAC files that have multiples of one tag, like multiple artist tags, tag.exe will only copy the first instance of that tag that it finds instead of copying all of the tags. That would be really nice if it were fixed.
Title: Re: Changes Made to TAG.EXE
Post by: Busby on 2022-03-11 01:59:53
I know this post has been running for some time, but I have been trying to automate the writing of tags on my radio station for almost 20 years, without success.

I found tag.exe but until recently couldn't work out how to use it, and now I have, but there is a limitation I need help with.

The limitation is that when I write ID3 tags from the filename it doesn't write all the tag as there seems to be a character limitation.

This is typical of the file I use in the renaming:

c:\Radio\Housekeeping\Tag.exe  --auto --scheme "A - T" "c:/Radio/Enhanced Sessions/part 01/*.mp3"

And this is typical of the file I would like to tag:

Enhanced Music @enhancdmusic - Enhanced Sessions Episode 123 #ES123

Can anyone tell me if this is possible with tag.exe or not please, and if it is, what I need to change.

I'm using version tag_2.0.52