1. Andrew's Corner :

abcde: Command Line Music CD Ripping for Linux

I have tried a variety of programs to rip my personal collection of music from CD to computer. I found significant shortcomings with many of the GUI programs and throughout I was also a little nonplussed at the complexities of whole process. Fortunately I came across the script known as abcde which eliminates the needless froth of the GUI as well as seamlessly takes care of much of the complexity of the process. This small guide aims to demonstrate to Linux users how to harness this amazing script for their own purposes. I will describe on this page how to rip and encode music cds to six different music formats: MP3, Ogg Vorbis, FLAC, Musepack, AAC and Opus and to top it all off show how with a single command a music cd can be encoded to all six at the same time. I will also for the sake of completion demonstrate the syntax required to convert CDs that contain the spoken word to Speex.

Menus for abcde

abcde can be operated purely from the commandline but it is much easier to run the program from a configuration file. abcde looks for two of these files at startup: /etc/abcde.conf and $HOME/.abcde.conf. The file /etc/abcde.conf is a fully commented configuration file that is well worth looking at if only to copy to your home directory as $HOME/.abcde.conf (as is most usually done). But my gift to you, Gentle Reader, is a set of $HOME/.abcde.conf files that will achieve great results "straight out of the box" and will simply require the command abcde or abcde -1 to run the whole process:

  1. ~/.abcde.conf for MP3
  2. ~/.abcde.conf for Ogg Vorbis
  3. ~/.abcde.conf for FLAC
  4. ~/.abcde.conf for MPP/MP+(Musepack)
  5. ~/.abcde.conf for M4A/AAC
  6. ~/.abcde.conf for Opus
  7. ~/.abcde.conf for MP3 + Ogg Vorbis + FLAC + Musepack + M4A/AAC + Opus
  8. ~/.abcde.conf for Speex

Feel free to use these and call them your own although I would encourage you to work on them a little and tweak them to match your own needs.

~/.abcde.conf for MP3

Who can escape MP3? I have placed this menu at the top of the list as I realise most people have MP3 players these days and many equate music encoding with MP3, bear in mind however that MP3 is a proprietary format and there are equally good formats that are totally free. Best to note here as well that with abcde 2.6 tagging is done using eyeD3 which is a significant change from older versions of abcde. I use eyeD3 0.7.5 and it has given me no trouble at all.

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       MP3 format using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for MP3. In this case
# the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc.
MP3ENCODERSYNTAX=lame 

# 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/lame
LAME=lame

# Specify your required encoding options here. Multiple options can
# be selected as '--preset standard --another-option' etc.
# The '-V 2' option gives VBR encoding between 170-210 kbits/s.
LAMEOPTS='-V 2' 

# Output type for MP3.
OUTPUTTYPE="mp3"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

The most obvious area to change is the MP3 encoding options but you will find that the example above will deliver perfectly acceptable sound on most systems.For those who want the maximum possible bitrate you could always try a slightly crazy -V 0 which gives between 220-260 kbits/s. Encoding is done post-encoding so options can be added here for this as well.

~/.abcde.conf for Ogg Vorbis

This format arguably produces better sound than MP3 at a smaller file size and it is completely free. You would do well to use the AoTUV modified oggenc, as I have done, for the ultimate ogg vorbis experience!

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       Ogg Vorbis using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for Ogg Vorbis. In this case
# vorbize is the other choice.
OGGENCODERSYNTAX=oggenc

# 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/oggenc
OGGENC=oggenc

# Specify your required encoding options here. Multiple options can
# be selected as '-q 6 --another-option' etc.
# The '-q 6' setting gives VBR encoding between 192-224 kbits/s.
OGGENCOPTS='-q 6'  

# Output type for Ogg Vorbis
OUTPUTTYPE="ogg"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Again the first are for change would be the -q 6 setting but I believe that most will be happy with the sound produced at this level. Options are from -1 to 10 or of course you can place your own custom ogg encoding options here, have a look at Hydrogenaudio for some thoughts on this.

~/.abcde.conf for FLAC

FLAC stands for Free Lossless Audio Codec and it is the only lossless codec used here. I have not used it extensively myself as the trade off is very large file size, but the sound quality cannot be matched by MP3 or ogg regardless of quality settings.

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

# 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='--verify --compression-level-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.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Tagging is done post encode with metaflac so feel free to add some tagging options to the above configuration file. A final note: well worth chasing down is flac 1.3.1 whic was released in late 2014.

~/.abcde.conf for MPP/MP+(Musepack)

abcde 2.6 features an update to Musepack SV8 which was added to the script by myself when I was briefly a contributor to abcde! So here is an $HOME/.abcde.conf file to start your own exploration of this quality format which should be better known and appreciated.

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#  MPP/MP+(Musepack) format using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for MPP/MP+ (Musepack). In this case
# there is no other choice.
MPCENCODERSYNTAX=mpcenc 

# 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/mppenc
MPCENC=mpcenc 

# Specify your required encoding options here. Multiple options can
# be selected as '--standard --fade 5' etc.
# The --extreme setting gives an encode of about 210 kbits/s.
MPCENCOPTS='--extreme'

# Output type for MPP/MP+ (Musepack).
OUTPUTTYPE="mpc"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Tagging is done during encoding with mpcenc so extra tagging options must be added in with the encoding options. For those who wish to explore the Musepack encoding options a little more the command mppenc --longhelp will show the details. The first thing to manipulate might be the encoding options although this produces a perfectly adequate output file with a bitrate of about 210 kbps.

~/.abcde.conf for M4A/AAC

There are two choices for aac encoding at the moment: NeroAacEnc and faac. I have remained with faac in part because I know it is more accessible to Linux users, in part because NeroAacEnc needs a little more work in abcde and in part because I would really like to use fdk aac. And of course the best aac under Linux is actually qaac under Wine!

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       m4a/aac using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for m4a/aac. In this case
# faac is the only choice.
AACENCODERSYNTAX=faac

# 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/faac
AACENC=faac

# Specify your required encoding options here. Multiple options can
# be selected as '--best --another-option' etc.
# The '-q 400' option gives VBR encoding with a max bitrate of 175 kbits/s.
AACENCODEROPTS='-q 400 -w -s'

# Output type for m4a/aac.
OUTPUTTYPE="m4a"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Tagging is with AtomicParlsey post encode and please note that the -s option I use in AACENCOPTS requires the most recent version of faac.

~/.abcde.conf for Opus

Opus is the new kid on the block and this totally free codec promises great things for both voice and music. I give an abcde.conf file below more suited for music and I challenge you to investigate this great codec a little further!

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       Opus using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for Opus. In this case
# the only choice is opusenc.
OPUSENCODER=opusenc

# 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/opusenc
OPUSENC=opusenc

# Specify your required encoding options here. Multiple options can
# be selected as '--preset standard --another-option' etc.
# In vbr mode the bitrate setting allows for a range of bitrates, use
# --cvbr or --hard-cbr for exact bitrate control...
OPUSENCOPTS="--vbr --bitrate 128"

# Output type for opus.
OUTPUTTYPE="opus"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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.6'             # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Tagging for Opus is done during the encode (inline) so any tagging options need to be added in with the standard Opus options.

~/.abcde.conf for MP3 + Ogg Vorbis + FLAC + Musepack + M4A/AAC + Opus

This one is the grandaddy of the all and is demonstration of the power of abcde. With this $HOME/.abcde.conf file a music cd is ripped and encoded to six formats at the same time and the resulting albums are then sorted into six different subdirectories.

# -----------------$HOME/.abcde.conf----------------- #
# 
#   A sample configuration file to convert music cds to 
#      MP3, Ogg Vorbis, FLAC, Musepack & AAC 
#          using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

OGGENCODERSYNTAX=oggenc                   # Specify encoder for Ogg Vorbis
MP3ENCODERSYNTAX=lame                     # Specify encoder for MP3
FLACENCODERSYNTAX=flac                    # Specify encoder for FLAC
MPCENCODERSYNTAX=mpcenc                   # Specify encoder for Musepack
AACENCODERSYNTAX=faac                     # Specify encoder for AAC
OPUSENCODERSYNTZX=opusenc                 # Specify encoder for Opus

OGGENC=oggenc                             # Path to Ogg Vorbis encoder
LAME=lame                                 # Path to MP3 encoder
FLAC=flac                                 # Path to FLAC encoder
MPPENC=mppenc                             # Path to Musepack encoder
AACENC=faac                               # Path to AAC encoder
OPUSENC=opusenc                           # Path to Opus encoder

OGGENCOPTS='-q 6'                         # Options for Ogg Vorbis
LAMEOPTS='-V 2'                           # Options for MP3 
FLACOPTS='--verify --compression-level-8' # Options for FLAC
MPPENCOPTS='--extreme'                    # Options for Musepack
AACENCOPTS='-q 250 -w -s'                 # Options for AAC
OPUSENCOPTS="--vbr --bitrate 128"         # Options for Opus
 
OUTPUTTYPE="ogg,mp3,flac,mpc,m4a,opus"    # Encode to all 6 formats!

CDROMREADERSYNTAX=cdparanoia            
CDPARANOIA=cdparanoia  
CDPARANOIAOPTS="--never-skip=40"

# Give the location of the CD identification program:       
CDDISCID=cd-discid           
                               
OUTPUTDIR="$HOME/music"               
ACTIONS=cddb,playlist,read,encode,tag,move,clean
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}'
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'

mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]
}
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.6'               # Place a comment...
EJECTCD=y                                 # Please eject cd when finished :-)

The part of the script that steers this is the simple ${OUTPUT} part. Run the script and have a listen to all six formats: a fascinating exercise that invites some interesting comparisons! And perhaps I might suggest if you wish to use the "6 codecs" method that you both beef up the MAXPROCS option in your ~/.abcde.conf and also buy yourself a bigger HDD?

~/.abcde.conf for Speex

Speex is down the bottom here as it is designed for the spoken word, not music, and because its role has pretty much been taken over, or 'obsoleted', by Opus. Give it a try on your audio cds and have a last look at Speex before it goes completely!

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       Speex using abcde version 2.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for Speex. In this case
# speexenc is the only choice.
SPEEXENCODERSYNTAX=speexenc

# 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/speexenc
SPEEXENC=speexenc

# Specify your required encoding options here. Multiple options can
# be selected as '-q 6 --another-option' etc.
SPEEXENCOPTS='--quality 8 --vad --comp 5'  

# Output type for Speex
OUTPUTTYPE="spx"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            
                                     
# Give the location of the ripping program and pass any extra options:
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}.${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'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | 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
EJECTCD=y                               # Please eject cd when finished :-)

Speex is approaching the end of its life but I will leave this configuration file here for perhaps another year, just in case there are any speex devotees out there. Send me an email if you are still using speex and it will stay longer!

And in conclusion...

Of all the pages that I have written for Linux this one has been the most fun. I guess because abcde is such a beautifully written script that invites you to explore programs that are all gems in their own right. Please feel free to use the email address at the base of this page to pass on your thoughts about this page, any corrections, praise or condemnation. And remember: Have fun!