Cut an APE file into pieces using a CUE file

If you ever encounter one of those old APE files, you should consider either recoding it to FLAC or simply cut it up and put it into a lossy OGG container. Here I will go through the command-line steps to do that last option.

Say we start off with these files:

CDImage.ape
CDImage.cue

First let's get the needed tools:

sudo aptitude install shntool cuetools gstreamer0.10-ffmpeg vorbis-tools

Now, decode the file into WAV, and start hacking it up with the CUE. First decoding the APE file:

gst-launch filesrc location="CDImage.ape" ! decodebin ! wavenc ! filesink location="CDImage.wav"

Then let's hack it up into pieces:

cuebreakpoints CDImage.cue | shnsplit CDImage.wav

Now we have a collection of WAV files named split-track01.wav split-track02.wav etc. etc. We can simply recode them to OGG using the following:

oggenc split*.wav

Done and done! Enjoy.