Also ... where have I been for the last three years ? Honestly, I have no idea where the time went. I just sat down in front of the computer and when I got up to make another pot of coffee it was 2009. Weird. If you're so inclined, I post to twitter as @eleuthero these days. My commentary is just as fatuous and puerile as it has traditionally been here, but at least there it's mercifully constrained to 140 incoherent characters.
#!/bin/bash # Script to downsample all mp3s downstream in the file system. # 2009.17.V. R. Jones <raven.jones@gmail.com> # Requires /usr/bin/lame. # A new folder will be created in the current directory and as the downsampling happens, # a copy of the downstream file system structure will be created in the new folder. # Usage. if [ $# -ne 1 ]; then echo "usage: $0 <bitrate in kbps>" exit 1 fi # Grab the requested bit rate off the command line. BITRATE="$1" # Create a folder to contain a copy of the file system containing the downsampled mp3s. /bin/mkdir -p ./${BITRATE} # Iterate over every downstream mp3, downsampling it and copying the result into the new folder. find . -name "*.mp3" -printf "%f:%h\n" | while IFS=":" read NAME PATH do # Create a folder for the album if it doesn't already exist. /bin/mkdir -p "./${BITRATE}/${PATH}" # Downsample the mp3 using /usr/bin/lame. /usr/bin/lame --preset ${BITRATE} "./${PATH}/${NAME}" "./${BITRATE}/${PATH}/${NAME}" done