Last active
October 8, 2015 04:48
-
-
Save SamWhited/3280305 to your computer and use it in GitHub Desktop.
Scripts I wrote to manage my music collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Wrap FLAC files in an OGG wrapper (.oga file). | |
# Deletes the original flac file after verifying that the oga file matches. | |
# For safety all warnings are treated as errors (and prevent deletion of flac files). | |
# | |
# WARNING: Does not prompt before overwriting `.oga' files. | |
# | |
# Examples: | |
# | |
# $ flac2ogg flacfile.flac | |
# -> flacfile.oga | |
# | |
# $ find ~/Music -name "*.flac" -type f -print0 | xargs -0 flac2ogg | |
# -> Converts all FLAC files in the music directory tree | |
args=("$@") | |
for ((i=0; i < $#; i++)) { | |
flac --decode-through-errors --force --verify --delete-input-file -w --best --ogg "${args[$i]}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Recursively rename all *.oga files in the current tree to .ogg | |
# | |
# WARNING: This will rename everything in the current tree. Don't run at `/'. | |
find -L . -type f -name "*.oga" | while read FNAME; do | |
mv "$FNAME" "${FNAME%.oga}.ogg" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Recursively rename all *.ogg files in the current tree to .oga | |
# | |
# WARNING: This will rename everything in the current tree. Don't run at `/'. | |
find -L . -type f -name "*.ogg" | while read FNAME; do | |
mv "$FNAME" "${FNAME%.ogg}.oga" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment