Created
December 27, 2012 11:50
-
-
Save dermesser/4387687 to your computer and use it in GitHub Desktop.
Little bash script to clean up file names of ogg files and transcode them to 64 kbit/s for my phone
This file contains 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
#!/bin/bash | |
# Usage: | |
# | |
# Go to the directory you want to contain the transcoded files and | |
# call this script: $ downcode.sh /path/to/ogg/files/to/be/transcoded | |
# The transcoded ogg files containing the old tags are placed in $PWD. | |
# --> Spaces are replaced by underscores (_) in both the file names of the | |
# ogg files being transcoded and the new ogg files! | |
rename 's/ /_/g' $1/*.ogg | |
OGGFILES=`find $1 -name '*.ogg'` | |
for FILE in $OGGFILES; | |
do | |
oggdec -o temp.wav $FILE | |
oggenc -q0 -o `basename $FILE` temp.wav | |
rm temp.wav; | |
vorbiscomment -l $FILE | vorbiscomment -w `basename $FILE` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment