Rip, Convert, Listen: The Sequel

If you listen to Ogg Vorbis files, KRename and EasyTAG makes organizing those files a snap.
Last month’s column showed how to create Ogg Vorbis (OGG) music files. Raw WAV files were “ripped” from compact discs with Grip, and were then converted to OGGs with the command line tool oggenc.
The end of the column mentions two additional programs: KRename (http://www.krename.net), a batch-mode file renamer, and EasyTAG (http://easytag.sourceforge.net/), which adds and edits the hidden metadata your music players use to display song information. This month, let’s take a further look at those two tools.

Rename En Masse

KRename is an incredibly powerful program, as it can rename just about anything This article focuses on a single task, but it should be enough to get you going. Much more extensive documentation is available on the project web site.
After you’ve downloaded and installed KRename (it’s available via APT), launch the application. On the first screen, choose “Add Files,” navigate to your OGGs, select them, and press Open.. When we left our music last time, the files were named like this:
The_White_Stripes_-_Elephant_-_09_-_The_Hardest_Button_To_Button.ogg
The_White_Stripes_-_Elephant_-_10_-_Little_Acorns.ogg
Once you’ve loaded all the OGGs in KRename, press Next. The “Destination” screen controls where new files go. To change the files you’re renaming, select both Rename input files and Overwrite existing files. Since this can be dangerous, you should also check Create an undo script. Specify a location and name for the script, and now you can recover if things don’t work. Again, press Next.
The “Plug-ins” page enables KRename to work with just about any type of file in existence. This isn’t needed for OGGs, so just press Next. The final screen is the biggie — it’s where you actually change the name of the file.
Press the Find and Replace button. Find The_White and replace it with White. Press Add. Find Elephant and replace it with Elephant_(2003). Press Add. That should take care of things, so press OK. Press the Finish button, and in just a few seconds, KRename reports success. Close KRename and check out your newly-named OGGs.

Edit the Tags

EasyTAG edits the descriptive metadata contained inside each OGG — metadata that’s displayed in most music players during playback. You can download EasyTAG from the web site or use APT. Once installed, run the program.
Two windows open, a big one and a little one. In the little window, enter this into the “Scan Tag” box:
%a_-_%b_-_%n_-_%t
The scan tag allows EasyTAG to automatically convert a descriptive file name into a set of descriptive tags. In the pattern above, %a is artist, %b is disc name, %n is track number, and %t is track name. Now EasyTAG knows how to read our file names.
In the big window, choose the “Settings” menu, and then “Preferences.” Select the “Scanner” tab, and check the box Overwrite fields when scanning tag.
In the big window, navigate in the left pane to the folder containing the renamed OGGs and select it. The OGGs should appear in a list in the middle pane, as shown in Figure One. Click on one of those OGGs (or press CRTL-A to select all of them), and then select the “File” menu and then “Scan File (s) ”. The current data appears in the right pane. Since we told EasyTAG how to read our filenames, the correct data should be displayed.
FIGURE ONE: EasyTAG can convert file names into metadata tags



Not everything is filled in, though. For “Year,” enter 2003. The second box after “Track” is the total number of tracks. For “Elephant,” that’s fourteen. Change the “Genre” to “Rock”, and enter whatever comment you’d like.
In the “File” menu, choose “Save File (s). ” EasyTAG changes the metadata for each file, and now things should show up correctly in your music players.
Enjoy The White Stripes!

R. Scott Granneman teaches at Washington University, consults for Bryan Consulting, and writes for SecurityFocus and Linux Magazine. You can reach him at class="emailaddress">scott@granneman.com.

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62