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
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.
TRACKNUMBER=1
GENRE=Hard Rock
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:
02_No_Way_But_The_Hard_Way.ogg
03_Blonde,_Bad_And_Beautiful.ogg
04_Raise_The_Flag.ogg
05_Bottom_Of_The_Well.ogg
06_White_Line_Fever.ogg
07_It_Ain't_Over_Till_It's_Over.ogg
08_Steeltown.ogg
09_Chewin'_The_Fat.ogg
10_Get_Busy_Livin'.ogg
11_Armed_And_Dangerous.ogg
12_Overdrive.ogg
13_Back_On_The_Bottle.ogg
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.
#
Hi Linerd,
I am wondering if what you posted here regarding "lltag" as applied to ogg files will work for mp3 files as well?
Thanks.
Bobot
#
Hi bobot,
Yes, I believe lltag will work with mp3's as well. As long as the required libraries are loaded, it should work. Fire up Synaptic and find lltag. Right click on it and select "Recommended Packages". Then just make sure the packages for mp3 are installed.