Splitting FLAC files on Ubuntu
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 shntoolSplit 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 *.flacTroubleshooting
If the following error appears when running cuetag:
warning: number of files does not match number of tracks
cueprint: error: track number out of rangePossible 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.