MacPorts / HomeBrew – Rip CD tracks from terminal

| | | |

I’m mainly doing this project for my church where the CD will typically only have one track and the MP3 bitrate is acceptable at 64 kbit/s

Yes there are faster options that also are free but this is the best option I’ve found to make it an easy process someone can start and chat with people once starting and then upload/copy it to the site.

First download and install MacPorts (from https://www.macports.org/install.php) or HomeBrew (from http://brew.sh/)

# MacPorts
sudo port install cdparanoia sox

# HomeBrew
brew install cdparanoia lame sox
cdparanoia -vsQ
cdparanoia -B
drutil eject

At this point we will convert the wav to an MP3, if you’d like a higher/lower bitrate change the 64 to one of these: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320

lame -b 64 track01.cdda.wav -o Sermon_2016_04_24.mp3
rm track01.cdda.wav

If you need to combine files, sox will help combine the files. The example below will put track01 in front of track02 in a single wav file.

sox track01.cdda.wav track02.cdda.wav Sermon.wav

Now for the complete script it’s rather simple especially if you do it the day of the sermon.

cdparanoia -B
drutil eject
lame -b 64 track01.cdda.wav -o Sermon_`date +%Y_%m_%d`.mp3
rm track01.cdda.wav
Originally Posted on May 22, 2016
Last Updated on November 5, 2017
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.