Differences between revisions 2 and 3
Revision 2 as of 2010-07-28 07:49:50
Size: 890
Editor: SamatJain
Comment: Recompressing FLAC files
Revision 3 as of 2011-07-03 00:26:12
Size: 1782
Editor: SamatJain
Comment: Splitting monolithic FLAC files with CUE sheets
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
{{{#!highlight sh {{{#!highlight sh numbers=off
Line 16: Line 16:
{{{#!highlight sh {{{#!highlight sh numbers=off
Line 24: Line 24:
{{{#!highlight sh {{{#!highlight sh numbers=off
Line 26: Line 26:

== Splitting ==

=== FLAC with .CUE files ===

Sometimes, a FLAC file is distributed as a monolithic FLAC file with a .CUE sheet describing when tracks start/end. To split the monolithic file into smaller ones:

{{{#!highlight sh numbers=off
sudo aptitude install cuetools shntool

cuebreakpoints monolithic.cue | shnsplit -o flac monolithic.flac
cuetag monolithic.cue split-track*.flac
}}}

Sometimes, the .CUE sheet is included with the FLAC. To get it:

{{{#!highlight sh numbers=off
# If .CUE sheet is in cuesheet block
metaflac --export-cuesheet-to=monolithic.cue monolithic.flac
# If .CUE sheet is in tag
metaflac --show-tag=CUESHEET monolithic.flac | grep -v ^CUESHEET > monolithic.cue
}}}

Source: [[http://aidanjm.wordpress.com/2007/02/15/split-lossless-audio-ape-flac-wv-wav-by-cue-file/|Split lossless audio in Ubuntu]]

Consistency checking

FLAC

FLAC files already contain MD5 sums of stream data, so changes to other metadata (artist, track title, etc) will not perturb this checksum. flac can be used to check FLAC files:

flac -ts *.flac

Some FLAC files cannot be checked, with the self-explaining warning:

WARNING, cannot check MD5 signature since it was unset in the STREAMINFO

The best thing to do is decode and recompress the FLAC files to contain an MD5 header. In the process, decoding is an effective check for frame damage. To rencode such files in-place:

flac --best -f *flac

MP3

Checkmate MP3 checker is a simple and fast tool for checking MP3 files, particularly checking for bad frames. Invocation:

mpck -qrB .

Splitting

FLAC with .CUE files

Sometimes, a FLAC file is distributed as a monolithic FLAC file with a .CUE sheet describing when tracks start/end. To split the monolithic file into smaller ones:

sudo aptitude install cuetools shntool

cuebreakpoints monolithic.cue | shnsplit -o flac monolithic.flac
cuetag monolithic.cue split-track*.flac

Sometimes, the .CUE sheet is included with the FLAC. To get it:

# If .CUE sheet is in cuesheet block
metaflac --export-cuesheet-to=monolithic.cue monolithic.flac
# If .CUE sheet is in tag
metaflac --show-tag=CUESHEET monolithic.flac | grep -v ^CUESHEET > monolithic.cue

Source: Split lossless audio in Ubuntu


CategoryCheatSheet

SamatsWiki: CheatSheet/Audio (last edited 2020-05-07 18:16:12 by SamatJain)