Skip to content

mikea/flac-cue-split

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flac-cue-split

Split lossless album images (.flac or .wv) into per-track FLAC files using matching CUE sheets.

Installation

Install dependencies:

sudo apt install bison flex pkg-config libwavpack-dev

If your distro package is older than 5.9.0, build and install WavPack 5.9.0 from https://www.wavpack.com/index.html and make sure wavpack.pc is available via PKG_CONFIG_PATH.

Installation:

cargo install --git https://github.com/mikea/flac-cue-split

Usage

Run (auto-detects one audio image file: .flac or .wv, plus .cue, in current directory):

flac-cue-split

Run with explicit files:

flac-cue-split --flac "Album.flac" --cue "Album.cue"
flac-cue-split --flac "Album.wv" --cue "Album.cue"

Run in a different directory (positional DIR):

flac-cue-split /path/to/album

Skip confirmation:

flac-cue-split -y

Overwrite existing outputs:

flac-cue-split -o

Set compression level (0-8 or max):

flac-cue-split -c 8
flac-cue-split --compression-level max

Pick a specific picture file:

flac-cue-split --picture cover.jpg

Disable picture auto-detect:

flac-cue-split --no-picture

Delete original input file after successful split:

flac-cue-split --delete-original

Rename original input file after successful split:

flac-cue-split -r

Force cue encoding:

flac-cue-split --cue-encoding windows-1251

Behavior

  • If either --flac or --cue is provided, the tool resolves a single input pair.
  • If neither is provided, the tool scans the chosen directory for .flac/.wv and .cue files.
  • Directory scan mode is valid when audio-image (.flac or .wv) and .cue counts match and every basename has both files (for example: Disc 1.wv + Disc 1.cue).
  • When there are several pairs, each source image is split into a subdirectory. The subdirectory name is derived by removing the longest common prefix and longest common suffix from all source basenames.
  • Output files are written using the pattern NN - Title.flac.
  • The tool prints a preview plan for all pairs (including shared tags and per-track unique tags), then asks for one batch confirmation (y/N).
  • In multi-pair mode, the confirmation prompt also supports S (Subdirs) to interactively edit per-pair output subdirectory names before running.
  • A progress bar is shown during encoding.
  • If --picture <FILE> is provided, that file is embedded as the cover image.
  • Otherwise, if there is exactly one image file in the chosen directory (jpg/jpeg/png/gif/bmp/webp/tif/tiff), it is embedded as a cover picture in all output files (unless --no-picture is used).
  • Cue encoding is auto-detected (UTF-8, otherwise Windows-1251) and shown in the plan. You can override it with --cue-encoding.
  • --delete-original removes the input source file after a successful split.
  • --rename-original (or -r) renames the input source file to *.processed after a successful split.

Options

  • --flac <FILE>: Path to input source file (.flac or .wv)
  • --cue <FILE>: Path to input CUE
  • --cue-encoding <ENCODING>: Force cue text encoding (example: windows-1251)
  • -y, --yes: Skip confirmation
  • -o, --overwrite: Overwrite existing output files
  • -c, --compression-level <LEVEL>: FLAC compression level (0-8 or max)
  • --picture <FILE>: Use a specific picture file
  • --no-picture: Disable picture auto-detection
  • --delete-original: Delete input source file after successful split
  • -r, --rename-original: Rename input source file to *.processed after successful split
  • DIR: Optional directory to scan for input files

About

Split flac files based on cue sheets

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages