Automated MP3 Ripping?
jimiUK asks: "I've been working for a while on my streaming mp3 server, using Apache:MP3 running on FreeBSD to start with but now running on RedHat Linux. It all runs smoothky, but what I'm trying to do is automate the ripping process so I can just insert cd's and have them ripped and classified automatically. This box is a dedicated server without a keyboard or moniter connected so I'd rather have no user input whatsoever. I've solved all of the initial problems, and now have the box set to login automatically on boot up, but I still can't find the right script. The most useful has been autorip, and I've also tried ripit (although it requires user intervention). My main problem is that if autorip cant find the cd information, it just stalls. My Perl skills are non-existent really so i'm not sure how to alter the script to instruct it to rip away if it doesnt find track info, which I could add in later. Does anyone have any other suggestions for alternative script front ends, or can point me in the right direction on altering autorip to get it over this hurdle." For those of you running MP3 servers, this idea might be a huge timesaver. Has anyone implemented such a system?
Check out
A Better CD Encoder (abcde)
and
Otto
I'm doing exactly what you describe with a spare laptop that had it's keyboard mangled.
I created a supervise/svscan job to monitor the CDROM and tun abcde if it finds a CD, which allows me to insert a CD and have the laptop eject the CD when it's done ripping.
Complete directory structure support for title/artist info.
freedb and cddb support.
otto then lets me play the new mp3s, and it makes life easier by managing them in mysql. I'd be happy to pay for abcde and otto, someone took the time to tie a bunch of tools and funtionality into a practical interface.
I foresee a problem here. The song title may contain a slash or other "naughty" character that isn't whitespace. Now, on Unix file systems, the slash is the only show-stopper, but I've heard complaints from Windows users that the question mark causes tremendous grief.
Just like when you write a CGI that accepts user input from a URL, your CDDB lookup is relying on outside information. Rather than stripping out a subset of characters that you know to be undesirable (whitespace in your case), you need to take the more proactive approach -- only allow characters you know you want, and clobber all the rest.
Also for what it's worth: I prefer cdparanoia for ripping, and I'd put the encoder and its options up at the top of the script where they can be configured more easily.
On the Windows side, Musicmatch does it, and on the Mac side, the default iTunes does it. Also, since you can display visualization for CDs, the data is being read at the same time it is playing... it's one more step to encode (hey! how about a "visualization" plug-in that encodes? I'm not sure if all data is fed to the plugins, though...)
If you're using a nice Multitasking OS, why not just write a script that starts encoding (you'd have to make sure it writes to the final files directly, and not some intermediate file), forks, and pauses 2 seconds, and starts playing the files by chronological order, starting with a date one minute in the past. Each time a song finishes, regenerate the playlist to reflect new songs that have been encoded, and progress through them. Then, you can be done encoding, and have it prompt you for another CD, even before the first has finished playing.
It doesn't even require perl - a simple bash script with find, plaympeg and your encoder of choice (abcde seems to be recommended) could easily accomplish this.
--
Evan
"$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
What I usually do with abcde is generate a playlist (which is created before any of the tracks are read), wait for one or two tracks to encode, and then play the list in any playlist-capable player. By the time the player gets to the next track, that track would have finished encoding.
Disclaimer: I wrote abcde.
You mention that Autorip stalls when it can't find the CD info... how would you prefer it worked? Unfortunately, without a display, the only option would be to silently eject the disc so you can go on to the next, and you'd never know that that disc didn't RIP.
Were I doing this kind of bulk ripping, I'd want it to rip the disc and put the files aside in a special directory. Then I would come back at the end of the day and enter the track info in a big batch. That way I could feed it disc after disc without thinking about it until I was ready.
The CD-ROM drives I have on my desktop are all awful for ripping; in particular, they are slow, error-prone, and woefully intolerant of scratches. One is so lousy that it will take 3 hours to rip a 45-minute CD.
Happily, one of them just died, so I'm looking for a replacement. What EIDE CD-ROMs are best for ripping? Or are they all equally good these days?
#!/usr/bin/perl
/dev/acd0c -I cooked_ioctl -s -b 16 -x -t$tknm $album$tknm.wav`;
#By Jason Denton, Copyright 2001
use Audio::CD ();
use MP3::Info;
$cddev = '/dev/acd0c';
$cd = Audio::CD->init($cddev);
$info = $cd->stat;
$cddb = $cd->cddb;
$data = $cddb->lookup;
$_ = $data->artist;
s/\W/_/g;
$artist = $_;
$_ = $data->title;
s/\W/_/g;
$album = $_;
$genre = $data->genre;
$tknm = 1;
$year = 2001;
foreach $track (@{$data->tracks($info)}) {
$_ = $track->name;
s/\W/_/g;
$title = $_;
$mp3name = "$artist\_$album\_$title.mp3";
`cdda2wav -D
`lame -m s -b 160 -h $album$tknm.wav $mp3name`;
`rm $album$tknm.wav`;
`rm $album$tknm.inf`;
set_mp3tag ($mp3name, $title, $artist, $album, $year, "", $genre,$tknum);
$tknm++;
}
Jason Denton Colorado State University [Thoughs and comments are my own, and not reflective of CSU]
I would like to extend this question by asking if it is feasible to rip and play at the same time? I don't see why not if you are ripping at >1x but has anyone ever managed to do this?
What I was wanting to do is to be able to pop in a CD, listen to it, and when I'm done listening to it, it will be archived in my MP3 collection for easier listening later.
I really haven't done much CD ripping though, so I'm no expert on the subject. Is this possible? Are there any tools out there that allow this (while still allowing the automated ripping like the origional poster asked)? Or can the music be ripped/encoded fast enough that the MP3 can just be listened to as it is being ripped? Anyone have any solutions?
I like Grip. This GPL program can be configured to rip+encode CDs upon insertion and will eject them when done ripping (encoding is a separate process which can be queued up for later since it takes longer than ripping). You can choose from several encoders and the CDDB info is automatically collected. If you install the companion program, Digital DJ, the CDDB info will be shoved into a MySQL database for easy music management/playlist manipulation later on.
If missing discs completely is acceptable to you, it would probably be very simple to hack the Perl scripts. I'm sure there's other hackers out there like me that would be happy to take a look at it. However, consider the above carefully first.
MadCow.
I used to have a sig, but I set it free and it never came back.