shnsplit
(part of the “multi-purpose WAVE data processing and reporting utility” shntool
package) provides a simple method to split flac files into individual tracks specified in a cuesheet.
$ shnsplit -o flac -f CUESHEET.cue -t %n.%t FLACFILE.flac
With the custom output format module, you can even transcode the tracks directly to another format, e.g. mp3, if your mobile music player doesn’t support flac.
snippets.dzone.com provides an exemplary script for this.
#!/bin/sh set -e ENCODE="cust ext=mp3 lame -b 192 - %f" FORMAT="%n.%t" FLACFILE=$1 CUEFILE=$2 echo $FLACFILE - $CUEFILE if [ -z "$FLACFILE" ]; then echo "usage: flac2mp3 FLAC_FILE [CUE_FILE]" exit 1 elif [ -z "$CUEFILE" ]; then DIRECTORY=$(dirname "$FLACFILE") BASENAME=$(basename "$FLACFILE" ".flac") CUEFILE="$DIRECTORY/$BASENAME.cue" fi shnsplit -O always -o "$ENCODE" -f "$CUEFILE" -t "$FORMAT" "$FLACFILE"
Helpful, thanks.