== 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: {{{#!highlight sh numbers=off 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: {{{#!highlight sh numbers=off flac --best -f *flac }}} === MP3 === [[http://checkmate.gissen.nl/|Checkmate MP3 checker]] is a simple and fast tool for checking MP3 files, particularly checking for bad frames. Invocation: {{{#!highlight sh numbers=off mpck -qrB .}}} mp3info (in Debian) can also check for bad frames: {{{#!highlight sh numbers=off mp3info -b "%b" ${filename} }}} == 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]] == Conversion == [[http://jak-linux.org/projects/dir2ogg/|dir2ogg]] finds all MP3s/FLACs/etc in a directory and converts them to Ogg Vorbis, preservings tags & metadata. Copy (or better yet, hard link) your media into a new directory, and run the following in that folder to convert to Ogg Vorbis (q=8): {{{#!highlight sh numbers=off dir2ogg -rf -q 8 --delete-input . }}} Make sure to copy! The above deletes files. ---- CategoryCheatSheet