Splitting FLAC Files from the Terminal

Published: July 28th, 2021
Updated: July 19th, 2022 - Removed unecessary screenshots.

Performing a clean high quality rip of a CD often results with a large single file such as a FLAC or WAV depending on how it's been ripped. In my case, it's a big .flac audio file which includes several tracks along with a .cue file which includes track start times. I've tried a variety of GUI applications, but I've found that the easiest and most simplest way of splitting up these types of audio files is to just do it in a terminal.

First, be sure that cuetools shntool and flac are installed which will allow you to run cuebreakpoints and shnsplit. If your single file happens to be a wave (.wv) then also install wavpack. The tool cuebreakpoints reads the break-points from the cue file which can be piped into shnsplit which is the program used to split up the tracks from the single file.

sudo pacman -Sy cuetools shntool flac

Now, navigate to the folder where the cue and flac files are located and run the following command.

cuebreakpoints file.cue | shnsplit -o flac file.flac

The end result isn't perfect as I'll have to rename and properly tag each file with Kid3-qt, but this is the easiest method I know of for splitting

Note: If you're working with a wave file (with the .wv extension), I like to convert to FLAC before splitting:

wvunpack audiofile.wv -o - | flac - -o audiofile.flac

Thanks for reading. Feel free to send comments, questions, or recommendations to hey@chuck.is