Here is a bit of a change from the usual datacenter type posts. A nameless friend of mine recently plugged her Ipod into a different PC that was set to auto-sync. It appeared to erase all of her MP3s from her Ipod without prompting or intervention. I am not familiar with iTunes, iPods, or any Apple products, but a quick search suggested this was a common occurrence. There are even a few software packages out there to recover the information, as the files don’t actually get deleted. It seems just some meta data gets removed. After running one such software package, all the MP3s were recovered, but some of them had weird file names or were missing various tag attributes. I tried using common MP3 tag editing software, such as MP3Tag, but found that I needed some logic to get everything squared away. I wrote a quick and dirty powershell script to standardize the filenames and tag information, based on which attributes were still present. Script is below.
ID3 Tag Editor is a Unicode supported app to tag MP3s and you can use it to add missing metadata values to your files in various languages. It also lets you add a cover art to your MP3 files which remains embedded in the main file itself.
Download the latest version of MP3Tag for Windows. Edit the ID3 labels of your MP3 and OGG files. Mp3tag is an easy to use application whose basic function.
Tag fields in Mp3tag The table below gives an overview of all ID3v2 / MP4 / WMA tag fields available with Mp3tag, their names in Mp3tag and their use in other programs. You can edit these tag fields through the extended tag dialog, add custom fields to the Tag Panel via 'Options Tag Panel' or customize the file list columns using these field.
As I continued to look through these files, I’d find different scenarios in the files that I needed to account for in the script. For example, a question mark (?) is OK to have in an MP3 tag, but not in a filename. As I went, I added these scenarios. The result is a procedural script to get the job done.
This MP3 tag editor software download is currently available as version 3.03. Compatibility may vary, but generally runs on a Microsoft Windows 10, Windows 8 or Windows 7 desktop and laptop PC. Mp3tag has been tested for viruses, please refer to the tests on the 'Virus Tests' page. It is published by Florian Heidenreich.
Now, you may not be solving the exact same problem that I was, but in this script, we show how to load an external .DLL in powershell, how to get and set MP3 tags with it, how to rename files, how to strip out illegal file characters and more! Lots of good stuff in here. It should make a pretty good starting point for any MP3 organization issue you need to sort out.
First, you”ll need the Taglib mp3 editing library. You can download that here. Just grab the .dll file and put it in the same directory that you run your powershell script from.
Finally, at the top of the script, add the path to your MP3 files that you need to edit. After you run this script, your MP3 files will get renamed like so: “Artist Name-Song Title.mp3”. The tags will also be updated to match.
Lets give credit where credit is due! I got the basics for this script from this blog post. Was this script useful to you? Have any other scenarios you would like to see handled by the script? Any issues running it? Let me know in the comments below.
Tag fields in Mp3tag
The table below gives an overview of all ID3v2 / MP4 / WMA tag fields available with Mp3tag, their names in Mp3tag and their use in other programs. You can edit these tag fields through the extended tag dialog, add custom fields to the Tag Panel via 'Options > Tag Panel' or customize the file list columns using these field names.
Please note that fields of VorbisComments (used with FLAC, OGG, SPX) and of APEv2 tags are not mapped internally by Mp3tag but are displayed with their actual name unless they have a user-defned mapping.
In case you need to change one of the mappings (e.g., for using consistent field names across formats), you can create user-defined field mappings.
ID3v2, MP4, Matroska and WMA tag fields
Tag fields exclusive to MP4
Annotations
Syntax: Either enter the value 1 or delete the field Note: Unofficial field that is only used by iTunes/iPod to mark albums as sampler.