DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Convert FLAC+CUE To MP3
#!/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"





