Skip to content

Instantly share code, notes, and snippets.

@don-smith
Last active February 25, 2017 04:41
Show Gist options
  • Save don-smith/6bda80ec1efbf51500e89d04f3164b96 to your computer and use it in GitHub Desktop.
Save don-smith/6bda80ec1efbf51500e89d04f3164b96 to your computer and use it in GitHub Desktop.
File conversion and clean up for SampleSwap library
#!/usr/bin/env sh
echo "Converting all aif files to wav ..."
find . -type f -name "*.aif" -exec bash -c 'ffmpeg -i "$0" "${0%.*}.wav"' "{}" \;
echo "Converting all mp3 files to wav ..."
find . -type f -name "*.mp3" -exec bash -c 'ffmpeg -i "$0" "${0%.*}.wav"' "{}" \;
echo "Renaming all *.WAV files to *.wav"
find . -type f -iname "*.WAV" -exec bash -c 'mv "$0" "${0%.*}.wav"' "{}" \;
echo "Making all wav files read-only ..."
find . -type f -name "*.wav" -exec chmod 0444 "{}" \;
echo "Removing all aif files ..."
find . -type f -name "*.aif" -exec rm "{}" \;
echo "Removing all mp3 files ..."
find . -type f -name "*.mp3" -exec rm "{}" \;
echo "All remaining files that are not *.wav:"
find . -type f ! -name "*.wav"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment