Skip to content
Splitting FLAC files on Ubuntu

Splitting FLAC files on Ubuntu

January 15, 2020

Note

This post may be partially machine- or AI-translated. If there is any discrepancy, the Korean version takes precedence.

Note

This post might be outdated and some links might not be available.

This is how to split a FLAC file that contains all tracks in one file.
This assumes the FLAC file and CUE file are in the same folder.

I worked on Ubuntu 18.04 LTS.


Install packages

Install the flac, cuetools, and shntool packages.

$ sudo apt install flac cuetools shntool

Split the FLAC file

Split it using the timecodes, track numbers, and titles from the CUE sheet.

$ cuebreakpoints 'cue file' | shnsplit -o flac 'source flac file' -f 'cue file' -t '%n.%t'

Add tags

Add tags based on the CUE sheet contents.

Rename the source FLAC file’s extension. (Moving it to another directory is also fine.)

$ mv 'source flac file' 'source flac file.backup'

Add the tags.

$ cuetag *.cue *.flac

Troubleshooting

If the following error appears when running cuetag:

warning: number of files does not match number of tracks
cueprint: error: track number out of range

Possible causes include:

  • Track 0 was created (00.pregap.flac)
  • The original FLAC file is still present

Delete track 0 or move the original FLAC file to another directory.

Last updated on