Skip to content

Instantly share code, notes, and snippets.

@beci
Forked from a-r-d/convert-and-split.sh
Created July 1, 2021 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beci/aeb2c49de4b4d506e8d80918d23d59fe to your computer and use it in GitHub Desktop.
Save beci/aeb2c49de4b4d506e8d80918d23d59fe to your computer and use it in GitHub Desktop.
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
#first install all the things:
sudo apt-get install flac ffmpeg mp3splt libav-tools shntool
# Okay first lets do an MP3:
# input files:
# --> cd.ape
# --> cp.cue
# (there are other options, like bitrate, but this is just the bare bones)
avconv -i cd.ape cd.mp3
# Now, split the MP3 file using the CUE file
# this will produce an mp3 file for each track in the same directory
mp3 split -a -c cd.cue cd.mp3
# Next example: FLAC!
# convert APE to FLAC:
ffmpeg -i cd.ape cd.flac
# Now, split your FLAC file. Credits for method go to the arch linux wiki:
# https://wiki.archlinux.org/index.php/CUE_Splitting
shnsplit -f cd.cue -t "%n %t" -o flac cd.flac
# one more note, you can go directly from APE -> FLAC with shnsplit because that
# tool is fucking awesome, but you need the "mac" encoder. This is a pain in the ass to get
# on ubuntu and ffmeg has the ability to convert APE, so I just show that way here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment