Split lossless audio files into tracks: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
Given a single lossless audio file (wav, flac, ape, wv, etc.) <code>foo</code> and corresponding cue sheet <code>foo.cue</code>, we can split it into separate tracks (compressed by flac) by the following command:<pre>$ shnsplit -f foo.cue -o "flac flac --verify --best -o %f -" -t "%n-%p-%t" -m " _" foo</pre>
Given a single lossless audio file (wav, flac, ape, wv, etc.) <code>foo</code> and corresponding cue sheet <code>foo.cue</code>, we can split it into separate tracks (compressed by flac) by the following command:<pre>$ shnsplit -f foo.cue -o "flac flac --verify --best -o %f -" -t "%n-%p-%t" -m " _" foo</pre>


See <code>man 1 shntool</code> for more options.
See <code>shntool(1)</code> for more options.


Note that the cue sheet may require removing trailing spaces.
Note that the cue sheet file may require removing trailing spaces and converting to utf-8.


Split points in cue sheet are often specified in the form <code>mm:ss:ff</code> (minutes:seconds:frames). There are 75 frames per second, so ff ranges from 00 to 74. <code>shnsplit</code> accept this format only for CD‐quality (i.e., 16/44.1) audio files. For other files (e.g., 24/192) the split point must be given in the form <code>mm:ss.nnn</code> (minutes:seconds:milliseconds):
Split points in cue sheets are often specified in the form <code>mm:ss:ff</code> (minutes:seconds:frames). There are 75 frames per second, so <code>ff</code> ranges from 00 to 74. <code>shnsplit</code> 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 <code>mm:ss:nnn</code> (minutes:seconds:milliseconds).  <code>nnn</code> is the integer part of <math>(40/3)\cdot{}</math><code>ff</code>


<code>nnn</code><math>{}={}</math><code>floor</code><math>(13.333\cdot{}</math><code>ff</code><math>)</math>
To split a Monkey's Audio (ape) file one should first convert it to wav:<pre>$ mac foo.ape foo.wav -d</pre>


<code>nnn<math>{}={}</math>floor<math>(13.333\cdot{}</math>ff<math>)</math></code>
[[Category: FreeBSD]]
 
[[Category: Linux]]
[[Category: Debian GNU/Linux]]

Latest revision as of 02:25, 16 December 2024

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 and converting to utf-8.

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). nnn is the integer part of (40/3)ff

To split a Monkey's Audio (ape) file one should first convert it to wav:

$ mac foo.ape foo.wav -d