Split lossless audio files into tracks

From Notes to self
Revision as of 13:04, 23 September 2011 by Verbovet (talk | contribs)
Jump to navigation Jump to search

Given a single lossless audio file (wav, flac, ape, wv, etc.) foo and corresponding cue sheet foo.cue, we can split it into separate tracks (compressed by flac) by the following command:

$ shnsplit -f foo.cue -o "flac flac --verify --best -o %f -" -t "%n-%p-%t" -m " _" foo

See shntool(1) for more options.

Note that the cue sheet file may require removing trailing spaces.

Split points in cue sheets are often specified in the form mm:ss:ff (minutes:seconds:frames). There are 75 frames per second, so ff ranges from 00 to 74. shnsplit accepts this format only for CD‐quality (i.e., 16/44.1) audio files. For other files (e.g., 24/192) the split points must be given in the form mm:ss.nnn (minutes:seconds:milliseconds). We can set

nnn=floor(13.333ff)