Ubuntu – Ripping Audio CDs to FLAC and MP3 with abcde

ubuntu-logo

I have an aging laptop that with Ubuntu 12.04 (Lucid) installed that I wanted to use to rip my CD collection to FLAC and MP3.

I didn’t want to have to use a GUI and I wanted the process to be as automated as possible – so I settled on the command line tool abcde (A Better CD Encoder).

First I installed all of the software required:

sudo apt-get install abcde cd-discid lame cdparanoia id3 id3v2

Then I made a backup of the abcde configuration file:

cp /etc/abcde.conf /home/myusername

I then copied and pasted a great abcde.conf file that I found online to /etc/abcde.conf:

sudo nano /etc/abcde.conf

This is the abcde.conf that I used:

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       MP3 format using abcde version 2.3.99.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.
LAMEOPTS='--preset extreme' 

# 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/"               

# 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}'

# 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=y                          # Useful for debugging
EJECTCD=y                               # Please eject cd when finished :-)

I found that this configuration work very well for me and I especially liked that it put my FLAC and MP3 files into different folders.

The only issue that I had was that abcde would ask me if I wanted to edit metadata for the CD that I was ripping, requiring user input to continue.

Fortunately I found a setting in my backed-up abcde.conf that lets abcde run in non-interactive mode:

# Define if you want abcde to be non-interactive.
# Keep in mind that there is no way to deactivate it right now in the command
# line, so setting this option makes abcde to be always non-interactive.
#INTERACTIVE=n

So, I simply added the following line to my abcde.conf and then I was set:

INTERACTIVE=n

All I have to do now is simply put a CD in the CD-ROM drive and then open a terminal and type:

abcde

Then when the CD ejects I simply put in the next CD, press the up arrow to bring up the last terminal command (abcde), and then press the Enter key to start the process over again.

Other than that I shared my music folder so that I can copy the FLAC and MP3 files to my desktop for backup.

All in all a great way to back up my CD collection with minimal fuss and interaction!

Update:

I did a clean install of Ubuntu 14.04 and there was an issue finding my cdrom drive. I successfully mounted the drive as follows:

sudo mkdir -p /mnt/cdrom
sudo mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
mount

After that I was able to run abcde as follows:

abcde -d /dev/sr0

Sources: Ubuntu Forum

Ubuntu / Linux Mint – Installing MediaInfo From PPA

MediaInfo is a handy application for querying media files about their video and audio bitrates and video resolution and so on:

  • General: title, author, director, album, track number, date, duration…
  • Video: codec, aspect, fps, bitrate…
  • Audio: codec, sample rate, channels, language, bitrate…
  • Text: language of subtitle
  • Chapters: number of chapters, list of chapters
  • Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1, MPEG-2, MPEG-4, DVD (VOB)…
    (Codecs: DivXXviD, MSMPEG4, ASP, H.264, AVC…)
  • Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF…
  • Subtitles: SRT, SSA, ASS, SAMI…

Installing MediaInfo on Ubuntu 9.10 (Karmic) and later releases is very simple via Personal Package Archive (PPA). Open a Terminal and enter the following commands:

sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get install mediainfo-gui

Now that MediaInfo is installed you can just drag and drop files into the application to query them.

That’s it!

Windows – Sound Output Switching Utility

Whenever I need to switch the sound on my Windows PC between my speakers and my headphones it annoys me to have to go into the Control Panel to do it.

With a little bit of searching I found a great little utility called Sound Shortcut.

The utility does not need to be installed to run – but I created a folder in C:\Program Files for it so that it would not be accidentally moved or deleted.

When you run Sound Shortcut you will see a new icon in your system tray (as circled in red below).

Right click the icon and you will see a menu with the option to run Sound Shortcut on start-up.

Click the Start-Orb then Control Panel and then the Sound icon and you will see your current sound outputs.

As you can see I just have my speakers and headphones listed (as I had removed my SPDIF output from the list).

Now that I have just the outputs that I need listed I can quickly and easily switch between them by pressing Alt+1 or Alt+2.

Switching between audio outputs really couldn’t be simpler!

Source: sevenforums.com

Ubuntu 10.4 Lucid – No Sound When Playing Flash Video On YouTube With Firefox

There are plenty of posts online about issues with sound when trying to play Flash video on YouTube with Firefox. I encountered this issue today on a fresh install of Ubuntu 10.4 Lucid and managed to fix it without too much difficulty.

I had just installed Ubuntu but had not bothered to run Update Manager yet – so my first piece of advice is to update your system and reboot (if it is not already up-to-date).

I then installed the Flash-Aid Add-on in Firefox. Flash-Aid allows you to uninstall and install various instances of Flash (or Linux equivalents) via a graphical interface. Click Tools, Add-ons, Get Add-ons and then search for Flash Aid and install the Add-on.

Restart Firefox and then click Tools and Add-ons again. Select the Flash-Aid add-on and then click the Preferences button.

I decided to uninstall Flash completely and start over – so I clicked the Expert Mode check-box at the bottom of the Flash Aid window and then clicked the Removal Options tab.

I selected everything that I had possibly installed previously and then clicked the Installation Options tab. Here I selected Adobe, from repositories.

Then I simply clicked the Script Preview tab followed by the Execute button – this ran the uninstall scripts followed by the installation script.

After this I still did not have sound working on YouTube – but running Update Manager and rebooting the computer fixed the issue.

Flash-Aid is a great tool for quickly and easily managing the version of Flash that you wish to use.