How to Automatically Rip CDs to MP3 with a Raspberry Pi
Categories:
Introduction
My wife has a huge, sorry, YUGE collection of CDs. She’d rather they’re all MP3s or some other digital format for
easier listening.
I was doing this on my PC, but it’s cumbersome and rather manual. I have a vision that I should be able to attach
my USB CD drive to my Raspberry Pi and have the ripper automatically start when I insert a CD, then eject when it’s
done. With such an approach, I could get through this task much more quickly.
Approach
Looks like we’re using a package called abcde.
Installation
I’m starting with this command line:
Okay.. things installed. The guide is a bit silent on where this configuration file is and how to use this utility
Okay, if I do this:
It makes sense, I haven’t attached the CDROM drive yet. But where would I define the CDROM parameter? Where’s the .cfg file?
Okay, there’s /etc/abcde.conf
Well it looks like all of the options are commented out so I’ll have to figure out what to set for each option.
It maybe works without all the options set.
First, let’s set the CDROM option.
I’ve attached the CDROM to the RasPi, let’s see where it showed up.
Here’s what I see:
This is how I modified the configuration file:
Looks like you need to run nano as sudo to get this to work.
It seems that it will always output in the current directory you run it from. We should try it.
I wonder where the MP3 quality options are?
Anyway, I set the CDROM option to the CD drive, created ~/rip and then ran abcde in it.
It’s starting to rip it.
It did ask a lot of questions. I’ll have to automate that.
Oh how nice its default format is ogg.
Configuration Options
Interactive Options
Easy peasy.
Execution Options
Interesting. I don’t think there’s much to do here yet.
Output Options
I’m going to say mp3.
Maximum Processes
I’m going to set it to 3.
Parallelization
I’m going to set it to ‘n’.
MP3 Encoder Syntax
I think I’ll be able to set the quality options I want here:
And the MP3 encoder is…
LAME
So, I make the option
And for the encoder options:
I think I’ll go with -V 0 then, like this:
Maybe if I set this, it won’t ask for which data source to use. I set it to musicbrainz.
MP3 Naming Options
So, what I have now is one folder for artists with multiple albums under it, so I’m going to do this:
Album Art
I want album art to be downloaded and saved as folder.jpg. Here’s what I have so far:
Then, adding getting album art as a step here:
Creating a RAM Drive for the WAV Output
I added this line to my /etc/fstab:
Then, I did this:
Then, I changed this line in the abcde config file:
Now, I’m going to see if this speeds things up by doing this:
Before and after the change to see the difference.
Using the RAM FS for WAV output:
And without:
Well, no real difference for a loss of about 800MB of RAM.
Fingerprinting MP3 Files
I’ve got a lot of CDs that are copies and it just can’t figure out what they are.
Maybe, but I copied the file and got it to work. Sadly, pyacoustid (the library we
use to identify songs) doesn’t return the album as well.
Maybe I can figure out what the album is from the artist and song, then copy and rename the thing to a proper directory structure and completely fill out the ID3 tags.