How to convert CD to mp3 command line linux

These days it isn’t very often I have a need to load a CD anymore. But occasionally I will end up with a new CD for one reason or another that needs to be converted to something I can load onto my phone. Here is my quick method for a command line way to convert an audio CD to mp3s.

This is a two step process

Prerequistes:

  • Linux with a bash shell
  • Have cdparanoia installed. $ sudo apt install cdparanoia
  • First Step: Convert the CD to WAV files using cdparanoia

    You should end up with some output as follows:

    Second Step: Convert the WAV files to MP3 using lame

    what we will do here is execute a simple bash loop that will find all wav files in the folder and iterate on converting them to mp3 via the lame tool.

    Now you should have your output files in mp3 format. At this point you can delete the wav files since they are no longer needed.

    There are a lot of possibilities for the above tools (lame and cdparanoia). I recommend reading the man pages if you want to encode files with more advanced options such as different bit rates, file formats etc.