0

Some flac files apparently have a “cuesheet metadata block”. I know how to split flacs files with shnsplit when I have a separate cuesheet at hand (cf. “How do I split a flac with a cue?”), but how do I split a flac when the cuesheet is stored inside a metadata block of the flac file?

Command-line preferred.

k.stm
  • 709
  • 1
  • 13
  • 25

1 Answers1

1

By exporting the cue-sheet to a file first. For example, metaflac has an --export-cuesheet-to=FILE option.

From man metaflac:

Export CUESHEET block to a cuesheet file, suitable for use by CD authoring software. Use '-' for stdout. Only one FLAC file may be specified on the command line.

For example:

f='file.flac'
bn=$(basename "$f" .flac)
cue="$bn.cue"

[ ! -e "$cue" ] && metaflac --export-cuesheet-to="$cue" "$f"
shnsplit -f "$cue" -t '%n-%t' -o flac "$f"
cas
  • 78,579
  • 1
    When I try this method the exported cue lacks title data which results in split files like 01-.flac. Is there a way to extract the cue with the titles embedded (because shnsplit uses the titles from the cue) ? – starfry Jul 04 '17 at 09:25