The ABC’s of creating MP3s



Being content with GUI ripping software was something that didn’t happen to me using Linux. I had expected my music player software to handle `the task but I can’t remember any that did (not remembering to me is the same as working poorly I’m discovering). As for stand-alone rippers I haven’t heard any that were notable. Because I’m a big fan of software being efficient and to the point (do one thing and do it well) I was a bit nonplussed when I began wondering how I was going to import my CDs to MP3s. A good number of tasks that I had regularly done through the GUI, I discovered are better done through the command line and though I haven’t tested every MP3-related application this looks like it may be true for them as well. Here’s a complete-ish guide to ripping, organizing, repairing, and volume normalizing an audio collection well, done mostly through the CLI.

Rip

RipIT is program that can do just about anything that a GUI version to do. It’s default options will be good enough for most cases (running ripit is all that is needed). Having a greater amount of control however can save time in the end. A wrapper script can be created to help with this:

The ripcd script below defines:

  • The ripping preset (extreme here because storage space isn’t an issue).
  • The directory creation template. RipIT goes online and gets the album tag information which can be used organize directories by tag (here the common "$artist/$album" is used”).
  • Looping (prompts when for new CD when ripping is done)
  • Ripping priority so RipIT plays nice with other programs.
  • Query the MusicBrainz music database instead as it is usually more accurate (editor approval required).
  • The Audio sub-directory to rip it (my Audio directory is divided as such: # ls ~/Audio/ Audiobooks Music Others Podcasts)

Normalize

Normalizing audio means to adjust the volume of audio files to a standard level. This is often a good idea as average volumes levels per album usually differ to some degree. A great program called mp3gain can do this easily. I created a script for this that first normalizes by type (either Music collection, or Audiobook collection… since there are usually differing recording standards for each), then normalize relative to other albums in that catagory. Here’s the script:

Repair

Lame is used by RipIT for encoding of the audio files and does a very good job of it, occasionally though I’ve found it to make a mistake. For these MP3s, previous rips, and for MP3s that have been previously downloaded it is good idea to check them and see if they are in good shape. An excellent tool called MP3 Diags can test MP3s and fix common problems. Repairing MP3s I’ve discovered makes inter-operability between different players play nice. MP3 Diags also includes a very nice (though basic) tag editor.

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

Posted on 2012-02-06, in Command Line, Linux, Music, Script and tagged . Bookmark the permalink. 4 Comments.

  1. nice… you should try abcde too. It does the trick for me since… forever.

  2. Another Thomas

    Why use a GUI?
    cdparanoia -B
    (cdda2wav is newer/faster but doesn’t rip hidden tracks, sad…)

    Why MP3?
    I’m using FLAC (PC) / OGG (Phone).

    Why normalizing?
    I’m using replaygain. (No, it’s note the same.)

    For MP3s you can do it in one step:
    for FILE in *.wav; do lame -q 0 -V 2 –noreplaygain -Y –scale $(wavegain -p -x “$FILE”) “$FILE” “${FILE%%.*}.mp3″; done

  3. nice… you should try abcde too. It does the trick for me since… forever.

    Hmm, now that you mention this, I have heard of it before. Shame I hadn’t remembered it before. Perhaps one day I’ll get a chance to check it out.

    Why use a GUI?
    cdparanoia -B

    Hmm, another way of doing it. Not sure what replaygain is though, not sure why I would need it. That for tip though will like to try if I get a chance.

  4. To be able to have ripit to be able to upload to CDDB, I use msmtp. Ripit looks for sendmail so change this I’ve done:

    sudo ln -s /usr/bin/msmtp /usr/sbin/sendmail
    sudo sed -i 's/sendmail -t -r/sendmail -t -f/g' /usr/bin/ripit

    and it works good. Haven’t tried msmtp-mta to see if it can do this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: