≡ Menu

Linux Rip Audio CD

How Do I Use This Script?

Download the script. Put audio cd into drive. Create directory to store mp3s, enter:
mkdir music
cd music
mkdir "Album name"
cd !!:1

See HowTo: Linux Rip and Encode Audio CDs

{ 4 comments… add one }
  • bas November 15, 2012, 8:40 am

    Very cool!
    But what about files name?
    Why i have to change handy?

  • Walter April 19, 2011, 6:46 pm

    Oops, I used a wrong variable for the usage example ^^

    mkdir -p "music/Album name"
    cd !$
  • Walter April 16, 2011, 8:12 pm

    The script should read

    # A simple shell script to rip an audio CD and create MP3s using lame
    # and cdparanoia.
    # ----------------------------------------------------------------------------
    # Written by Vivek Gite  and WS
    # (c) 2011 nixCraft under GNU GPL v2.0+
    # ----------------------------------------------------------------------------
    read -p "Starting in 5 seconds (to abort press CTRL + C)" -t 5
    if ! cdparanoia -B; then
    	echo "cdparanoia ended with error, bailing out" 1>&2
    	exit 1
    for i in *.wav; do
    	if lame --vbr-new -q 0 "$i" "${i%%.cdda.wav}.mp3"; then
    		rm -f "$i"
    		echo "Could not encode $i" 1>&2
    exit $rc

    I corrected spelling and added error checking. The script will now abort on a ripping error and won’t delete Wave files which have not been successfully encoded.
    If any error occurs, the exit code is not 0.
    Furthermore, “–vbr-new” and “-b 360” are contradictory options, the first telling lame to use variable bit rate and the second telling lame to use constant bit rate for encoding. I replaced the second with “-q 0” to achieve the best possible result.
    The usage example could be simplified with

    mkdir -p "music/Album name"
    cd $?
  • Peter Gaal October 20, 2010, 2:32 pm

    petike-nb# abcde -a cddb,read,encode,tag,move,playlist,clean -d /dev/cdrom -o mp3 -V -x

Security: Are you a robot or human?

Leave a Comment