RSS

High quality rip audio CD to FLAC with abcde on Mac and Linux

High quality rip audio CD to FLAC, AIFF, APE, MP3, M4A, etc. with abcde on Mac and Linux.

abcde - Rip an entire CD and compress it into various audio formats including Ogg/Vorbis, MP3, FLAC, Ogg/Speex, AAC, WavPack, Monkey’s Audio (ape), Musepack, True Audio (tta), MP2, and AIFF.

Why abcde

The usual process of extracting data from a CD, encoding it, and then tagging or commenting on it is quite complex. abcde automates this process. It converts an entire CD into compressed audio formats such as Ogg/Vorbis, MP3, FLAC, Ogg/Speex, Musepack, AAC, WavPack, Monkey’s Audio (ape), Opus, True Audio (tta), MP2, or AIFF. With a single command, it can:

  • Perform a CDDB or MusicBrainz query online to identify your CD, use a locally stored CDDB entry, or read CD-TEXT if available.
  • Download appropriate album art for your tracks with numerous configurable options for download and post-download modifications, including automated embedding for some containers.
  • Extract an audio track (or all tracks) from your CD.
  • Normalize the volume of each file (or the album as a whole).
  • Compress tracks into formats such as Ogg/Vorbis, MP3, FLAC, Ogg/Speex, Musepack, AAC, WavPack, Monkey’s Audio (ape), Opus, True Audio (tta), MP2, or AIFF, all in one read.
  • Add comments or ID3/ID3v2 tags.
  • Generate intelligible filenames.
  • Calculate replaygain values for each file (or the album as a whole).
  • Delete the intermediate WAV file (or save it for future use).
  • Repeat the process until complete.

Alternatively, abcde can rip a CD and convert it into a single FLAC file with an embedded cuesheet, which can later be used as a source for other formats, essentially acting as a compressed backup of your CD collection.

Install abcde

Install abcde on Linux:

% apt search abcde

abcde/noble 2.9.3-1 all
  A Better CD Encoder

sudo apt install abcde

Install abcde on Mac:

$ brew info abcde
==> abcde: stable 2.9.3 (bottled), HEAD
Better CD Encoder
https://abcde.einval.com
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/abcde.rb


$ brew install abcde

Config abcde

Put following config to $HOME/.abcde.conf to for generate FLAC output. You may customize it per your requirement.

# -----------------$HOME/.abcde.conf----------------- #
#
# A sample configuration file to convert music cds to
#       FLAC using abcde version 2.9.3
#
#         https://andrews-corner.org/abcde/
# -------------------------------------------------- #

# Encode tracks immediately after reading. Saves disk space, gives
# better reading of 'scratchy' disks and better troubleshooting of
# encoding process but slows the operation of abcde quite a bit:
LOWDISK=y

# Specify the method to use to retrieve the track information,
# the alternative is to specify 'musicbrainz':
CDDBMETHOD=cddb

# With the demise of freedb (thanks for the years of service!)
# we move to an alternative:
CDDBURL="http://gnudb.gnudb.org/~cddb/cddb.cgi"

# Make a local cache of cddb entries and then volunteer to use
# these entries when and if they match the cd:
CDDBCOPYLOCAL="y"
CDDBLOCALDIR="$HOME/.cddb"
CDDBLOCALRECURSIVE="y"
CDDBUSELOCAL="y"

# Specify the encoder to use for FLAC. In this case
# flac is the only choice.
FLACENCODERSYNTAX=flac

# Specify the path to the selected encoder. In most cases the encoder
# should be in your $PATH as I illustrate below, otherwise you will
# need to specify the full path. For example: /usr/bin/flac
FLAC=flac

# Specify your required encoding options here. Multiple options can
# be selected as '--best --another-option' etc.
# Overall bitrate is about 880 kbs/s with level 8.
FLACOPTS='-s -e -V -8'

# Output type for FLAC.
OUTPUTTYPE="flac"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac. New to abcde 2.7 is 'libcdio'.
# CDROMREADERSYNTAX=cdparanoia

# Give the location of the ripping program and pass any extra options,
# if using libcdio set 'CD_PARANOIA=cd-paranoia'.
# CDPARANOIA=cdparanoia
# CDPARANOIAOPTS="--never-skip=40"

# Give the location of the CD identification program:
CDDISCID=cd-discid

# Give the base location here for the encoded music files.
# OUTPUTDIR="$HOME/Music"

# The default actions that abcde will take.
ACTIONS=cddb,playlist,read,encode,tag,move,clean

# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM} ${ARTISTFILE} ${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}'

# Decide here how you want the tracks labelled for a standard 'single-artist',
# single-track encode and also for a single-track 'various-artist' encode.
# (Create a single-track encode with 'abcde -1' from the commandline.)
ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}'

# Create playlists for single and various-artist encodes. I would suggest
# commenting these out for single-track encoding.
PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u'
VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u'

# This function takes out dots preceding the album name, and removes a grab
# bag of illegal characters. It allows spaces, if you do not wish spaces add
# in -e 's/ /_/g' after the first sed command.
mungefilename ()
{
  echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
}

# What extra options?
MAXPROCS=2                              # Run a few encoders simultaneously
PADTRACKS=y                             # Makes tracks 01 02 not 1 2
EXTRAVERBOSE=2                          # Useful for debugging
# COMMENT='abcde version 2.9.3'           # Place a comment, this will write as value of DESCRIPTION tag.
EJECTCD=y                               # Please eject cd when finished :-)

Use abcde to generate flac with config file

With config file $HOME/.abcde.conf, Simple type abcde will work, you can also use -o flac to specific output format.

sudo abcde -o flac
Password:
Executing customizable pre-read function... done.
Getting CD track info... Volume Mozart: Arias on disk8 unmounted
Volume Mozart: Arias on disk8 mounted
Grabbing entire CD - tracks:  01 02 03 04 05 06 07
Found 0 matches so far
Trying lookup method cddb
Checking CDDB server status...
Querying the CDDB server...
Obtaining CDDB results...
Retrieved 1 match...
#1 (cddb): ---- Wolfgang Amadeus Mozart / ... ----
1: Die.. zum Lose
2: Mitridate,..
3: Don Giovanni,...
4: Ch'io mi scordi...
5: Don Giovanni,...
6: Misera,...
7: Die...

Which entry would you like abcde to use (0 for none)? [0-1]: 1
Selected: #1 ...
Year: 1987
Genre: Classical
...
Edit selected CDDB data [y/N]? n
Is the CD multi-artist [y/N]?
Creating playlist...
Grabbing track 01: ...
Encoding track 01 of 07: ...
encodetrack-flac-01 nice -n 10 flac -f -s -e -V -8 -o Music/CD/abcde.6c0d3d07/track01.flac Music/CD/abcde.6c0d3d07/track01.wav
track01.wav: WARNING: skipping unknown chunk 'FVER' (use --keep-foreign-metadata to keep)
encodetrack-01 true
Tagging track 01 of 07: ...
tagtrack-flac-01 nice -n 10 metaflac --no-utf8-convert --import-tags-from=- Music/CD/abcde.6c0d3d07/track01.flac
tagtrack-01 true
movetrack-01 mv Music/CD/abcde.6c0d3d07/track01.flac ...
movetrack-output-flac true
...
...
...
Volume failed to eject
Finished.

Troubleshooting

abcde: cd-discid is not in your path.

Symptom:

$ abcde -o flac
[ERROR] abcde: cd-discid is not in your path.
[INFO] Define the full path to the executable if it exists on your system.

Solution:

To fix abcde: cd-discid is not in your path., install cd-discid:

$ brew info cd-discid
==> cd-discid: stable 1.4 (bottled), HEAD
Read CD and get CDDB discid information
https://linukz.org/cd-discid.shtml
Not installed


brew install cd-discid

cd-discid: /dev/disk9: open: Permission denied

Symptom:

$ abcde -o flac
Volume Audio CD on disk9 unmounted
cd-discid: /dev/disk9: open: Permission denied
Error: cannot open device `/dev/disk9'
[ERROR] abcde: abcde-musicbrainz-tool failed to run; ABORT

Sulution:

Run with sudo:

$ sudo abcde -o flac
Password:
Executing customizable pre-read function... done.
Getting CD track info... Volume Audio CD on disk9 unmounted
Volume Audio CD on disk9 mounted
Grabbing entire CD - tracks:  01 02 03 04 05 06 07 08 09 10
Found 0 matches so far
Trying lookup method cddb
Checking CDDB server status...
Querying the CDDB server...
Obtaining CDDB results...
Retrieving multiple matches... done.
Retrieved 3 matches...
...

Sample abcde Usages

Basic CD Rip

abcde

This command will start the ripping process using the default settings in your .abcde.conf file.

Rip and Encode to MP3

abcde -o mp3

This command will rip the CD and encode the tracks to MP3 format.

Rip and Encode to FLAC

abcde -o flac

This command will rip the CD and encode the tracks to FLAC format.

Rip and Encode to Ogg Vorbis

abcde -o vorbis

This command will rip the CD and encode the tracks to Ogg Vorbis format.

Specify Output Directory

abcde -d /dev/cdrom -o mp3 -x -N -P -o /path/to/output

This command will rip the CD from the specified CD device /dev/cdrom, encode to MP3, and save the output to /path/to/output.

Rip CD and Save Logs

abcde -l

This command will rip the CD and save the logs of the process.

Use a Custom Configuration File

abcde -c /path/to/custom_abcde.conf

This command will use a specified custom configuration file for ripping the CD.

Rip CD with High-Quality MP3 Settings

abcde -o mp3 -a cddb,read,encode,tag,move,clean -x -B -p

This command will rip the CD, encode to high-quality MP3, and perform additional actions like cleaning up temporary files after the process.

abcede Commandline Options Reference

$ abcde -h
This is abcde v2.9.3.
Usage: abcde [options] [tracks]
Options:
-1     Encode the whole CD in a single file
-a <action1[,action2]...>
       Actions to perform, comma separated:
       (cddb,read,getalbumart,embedalbumart,normalize,encode,
       tag,move,replaygain,playlist,clean)
-b     Enable batch normalization
-B     Embed albumart (this also activates getalbumart)
-c <file>
       Specify a configuration file (overrides system and user config files)
-C <discid#>
       Specify discid to resume from (only needed if you no longer have the cd)
-d <device>
       Specify CDROM device to grab (flac uses a single-track flac file)
-D     Debugging mode (equivalent to sh -x abcde)
-e     Erase encoded track information from status file
-f     Force operations that otherwise are considered harmful. Read "man abcde"
-g     Use "lame --nogap" for MP3 encoding. Disables low disk and pipes flags
-G     Get album art by using the 'getalbumart' action
-h     This help information
-j <#> Number of encoder processes to run at once (localhost)
-k     Keep the wav tracks for later use
-l     Use low disk space algorithm
-L     Use local CDDB storage directory
-m     Modify playlist to include CRLF endings, to comply with some players
-n     No lookup. Don't query CDDB, just create and use template
-N     Noninteractive. Never prompt for anything
-o <type1[,type2]...>
       Output file type(s), comma separated
       (vorbis,mp3,flac,spx,mpc,wav,m4a,opus,mka,wv,ape,mp2,tta,aiff).
       Defaults to vorbis
-p     Pad track numbers with 0's (if less than 10 tracks)
-P     Use UNIX pipes to read+encode without wav files
-Q     CD lookup method(s), comma separated
       (musicbrainz,cddb,cdtext). Defaults to musicbrainz.
-r <host1[,host2]...>
       Also encode on these remote hosts
-s <field>
       Show fields from the CDDB info (year,genre)
-S <#> Set the CD speed
-t <#> Start the track numbering at a given number
-T <#> Same as -t but modifies tag numbering
-U     Do NOT use UNICODE (UTF8) tags and comments
-v     Show version number and exit
-V     Be a bit more verbose about what is happening behind the scenes
-x     Eject CD after all tracks are read
-w <comment>
       Add a comment to the CD tracks
-W <#> Concatenate CDs: -T #01 -w "CD #"
-z     Use debug CDROMREADERSYNTAX option (needs cdparanoia)

Tracks is a space-delimited list of tracks to grab.
Ranges specified with hyphens are allowed (i.e., 1-5).

Reference

OmniLock - Block / Hide App on iOS

Block distractive apps from appearing on the Home Screen and App Library, enhance your focus and reduce screen time.

DNS Firewall for iOS and Mac OS

Encrypted your DNS to protect your privacy and firewall to block phishing, malicious domains, block ads in all browsers and apps

Ad