Command Line Basics: Ripping Audio CD’s, Part 3
In part 1 of CLB: Ripping Audio CD's, I showed how to rip the songs from your CD and save them as WAV files. In part 2 I showed how to convert those files to Ogg Vorbis audio. Today in Part 3 I'm going to show a few ways to tag those Ogg Vorbis audio files from the command line.
In the last post we used the oggenc command from the vorbis-tools package. We're going to use another command from vorbis-tools to tag the files: vorbiscomment.
Using vorbiscomment is a manual process. You'll have to tag the files one at a time. For my example I'm going to use the album No Guts. No Glory. by the Australian hard rock band, Airbourne. In this example I use the -w switch to write tags as well as the -t switch for each individual tag. Note the use of single quotes for any items that contain spaces.
To list the tags you just wrote you can use the -l switch:
The output for this example looks like:
TITLE=Born To Kill
ALBUM=No Guts. No Glory.
The format of this tag listing is what you can use to enter tags interactively. To tag files in interactive mode, simply use:
Then you just type in the tags like above, hitting the [Enter] key after each tag. When you're done tagging the file, hit [Ctrl]+[D] to exit.
Whichever way you choose to do the tagging, you'll probably want to rename the files when you're done. You can do this with the mv command.
A More Automated Way
There is a more automated way to apply the tags and rename the files. There's a great little command called lltag. You should be able to find it in your distro's repositories. In Ubuntu you can install it with:
lltag is an interactive program that can search an online CD database for tags and apply them to your files. The files can also be renamed at the same time. To see how it will run without affecting your files you can use the --dry-run switch. I'd suggest using that since you may often find several versions of an album in the database and it may take a few tries to find the correct version. So an example command would look like this:
Once you're sure which album listing you want to use, you can use the --yes switch to tell lltag to use the default actions to tag your files.
You'll still have to choose the album you want from the listing, but after that everything is automated and all of your files get tagged. My listing of files now looks like this:
So those are the basics for using vorbiscomment and lltag to apply tags to your Ogg Vorbis audio files. In my next installment of Command Line Basics I'm going to show an even better command that does a much better job at automating this whole process.