Skip to content

Instantly share code, notes, and snippets.

@Chaircrusher
Created September 14, 2018 15:09
Show Gist options
  • Save Chaircrusher/f18957954ee236518017b21f541c3271 to your computer and use it in GitHub Desktop.
Save Chaircrusher/f18957954ee236518017b21f541c3271 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# If you buy the 24-bit wav version of the Aphex Twin Collapse EP
# copy this script into the directory where you've unpacked the WAV files
# and run it in that directory
p="$(ls *.jpg)" ; albumName="Collapse EP"; artistName="Aphex Twin"
for x in *.wav;do
trackTitle="$(echo $x | sed -e 's/^.*-//' -e 's/\.wav//')"
trackNumber="$(echo $x | sed -e 's/^.*EP-//' -e 's/-Aphex.*$//')"
flac --picture="3|image/jpeg|||${p}" \
-T "TITLE=${trackTitle}" \
-T "ARTIST=${artistName}" \
-T "TRACKNUMBER=${trackNumber}" \
-T "ALBUM=${albumName}" --best -s "${x}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment