IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Command line tool to export and import tags programmatically
g0a
post Aug 17 2012, 14:48
Post #1





Group: Members
Posts: 66
Joined: 30-April 03
Member No.: 6299



I’m playing with the idea to dump all tags of my collection into some sort of plain text or xml files and manage them in a VCS (Git). Is there any existing command line tool capable of dumping tag contents into a file and later on reapply the file contents to the audio file again?

Only WavPack and MP3 matter. Both Windows and Linux solutions are fine.
Go to the top of the page
+Quote Post
g0a
post Aug 18 2012, 10:22
Post #2





Group: Members
Posts: 66
Joined: 30-April 03
Member No.: 6299



Seems http://www.chreo.net/AudioTagExtractor/ would work for the exporting bit. Anyone aware of a tool that would tag an audio file based on information supplied via a text/csv/xml file?
Go to the top of the page
+Quote Post
romor
post Aug 18 2012, 17:28
Post #3





Group: Members
Posts: 607
Joined: 16-January 09
Member No.: 65630



No one replied to you, here is my far shot help: in this thread there is a script and instructions how to run it. It features example code for looping over ID3 frames and extracting wanted data (with id3com lib). Writing is done by wmenceng lib and communication is through XML, like you wanted.

That's for MP3, for WV I don't know if there is COM library so that you can reuse same approach


--------------------
Scripts (mainly foobar2000 related): http://goo.gl/yje3h
Go to the top of the page
+Quote Post
romor
post Aug 18 2012, 21:45
Post #4





Group: Members
Posts: 607
Joined: 16-January 09
Member No.: 65630



g0a, I checked above suggestion, and if you decide to use wmencoder you won't even need id3com. It will dump all ID3 to xml file, and "non-standard" tags will be encoded as hex cdata in WMENC_BLOB element, then just decode to stream.

Small snippet to dump all tags (dump_id3.vbs):
CODE
  Set WME = CreateObject("WMEncEng.WMEncBasicEdit")
  WME.MediaFile = "sample.mp3"
  WME.SaveConfigFile("conf.xml")

Result output (`cscript dump_id3.vbs`), with all sorts of tags, and even embedded image: http://pastebin.com/rHiWUmQr

Writing is easy (write_id3.vbs):
CODE
  Set WME = CreateObject("WMEncEng.WMEncBasicEdit")
  WME.MediaFile = "sample.mp3"
  WME.Start
  WME.ConfigFile = "conf.xml"
  WME.Stop

Done. That's it! Data from conf.xml will be written in sample.mp3 in second.

Reference for 9 series I'm referring: http://msdn.microsoft.com/en-us/subscriptions/ms990844.aspx
I don't know if later series are as easy, but it shouldn't matter as you just need one dll file for this approach. I guess you'll also need to register the file if you don't install whole package `regsvr32 wmEncEng.dll` to be usable

I was using id3com because I had to decode all cdata to find replay gain values, and using id3com made it much easier for that particular problem


--------------------
Scripts (mainly foobar2000 related): http://goo.gl/yje3h
Go to the top of the page
+Quote Post
g0a
post Aug 19 2012, 10:24
Post #5





Group: Members
Posts: 66
Joined: 30-April 03
Member No.: 6299



Excellent; thanks a lot for your efforts. I’m afraid though for APEv2 I have to come up with something myself using TagLib# or similar. Still feels like I'm reinventing the wheel. I have a hard time believing there is no exiftool-like application for audio files around yet.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd May 2013 - 18:56