The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Fastest way to database MP3s

Contributed by: Scot Hacker
This tip is valid for: Both BeOS and Haiku

Update: All of the principles in this tip still apply, but you can get most or all of this done much more easily with FlipSide’s MP3 Army Knife.

Since you’ll probably soon be using a BeIA-based home stereo component to play all of your MP3s through a central home server, you want to make sure you’ve got all your files ID3 tagged and attributed so you can run quick playlist queries through a Qubit Web pad from any room in the house. The time to get your database in order is now (even if you won’t be getting a BeIA home stereo device, this procedure is worth reading). Query-based playlists are a great BeOS advantage not easily replicated on other OSes.

id3attrs

If you’re encoding CDs to MP3, use a tool like RipEnc, which will make sure your files have appropriate ID3 tags and indexed attributes from the get-go. If you’re dealing with an existing collection copied over from another OS or have been downloading legal MP3 files, here’s the fastest way I’ve found to get everything in order. This may sound like a lot of work, but it’s actually very fast once you get the hang of the system.

Setup

  1. Make sure you’ve got the following tools installed: id3attr, id3ren, mp3tag, MP3 Tags and Attributes, Summon.
  2. If you want to be able to create query-based playlists later on, make sure you have appropriate indexes installed. For maximum query-ability, you’ll want to open a Terminal and run the following:
    mkindex Audio:Album
    mkindex Audio:Artist
    mkindex Audio:Comment
    mkindex Audio:Genre
    mkindex Audio:Title
    mkindex -t int Audio:Year
    

    Remember that indexes are per-volume, so if you have a large drive or drives you use for MP3 storage, do this procedure on each one, not just on your boot drive. See Manipulating filesystem indexes for more information on working with indexes.

  3. Add the following line to your /boot/home/.profile:
    alias idren='id3ren -template="%a - %s.mp3" -space=" "'

    This takes advantage of id3ren’s template naming feature, which will allow you to rename your files en masse, with consistent filenames.

Usage

  1. Sort your downloaded or copied MP3s into directories by artist and/or album (you’ve probably already done this).
  2. In an artist directory, tap Alt+A to select all, then Alt+Opt+M to bring up the MP3Tag Tracker add-on (Opt is your left Win key). This will let you batch tag all of the common fields, so you can set the artist, genre, and possibly other tags all at once. Pay special attention to the template feature in MP3Tag: If your files have consistent and reliable filenames, you can save yourself a lot of work by having MP3Tag automatically parse filenames into ID3 tags. Hit Save to commit the changes. If necessary, go back to the top of the directory and hit Alt+Opt+M for each file to enter the unique tags (song name, etc.), hitting Enter after each one.
  3. Launch a Terminal in that directory with Summon, by tapping Alt+Opt+S.
  4. Type id3attr *.mp3. This will copy all of the ID3 tags to corresponding attributes. BeOS will automatically add your attributes to the indexes, if you’ve installed them, so you can start running queries on those files’ newly created attributes. If you prefer to do this part from the Tracker, use the “MP3 Tags and Attributes” add-on, which will offer either to copy all ID3 tags into corresponding attributes, or to copy attributes into corresponding ID3 tags.
  5. Type idren *.mp3. This will rename all MP3s in the directory with the format:
    Artist Name - Song Name.mp3

    To use a different format, alter the template in the setup procedure above.

Sounds like a lot of work, but after you’ve got the setup done, the usage part is nearly painless, and the payoff in the long run will be worth it — especially if you have a large collection. You’ll be able to sort and sift through your MP3 in ways that aren’t possible on other platforms, and be able to create query-based playlists from any web interface.

See also:

Creating playlists from system queries
Manipulating filesystem indexes

Posted in Audio & Video


(comments are closed).