Created
February 21, 2012 16:56
-
-
Save RobotGrrl/1877360 to your computer and use it in GitHub Desktop.
Convert all files in directory to .WAV, with sequential numbering for file name
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 | |
FILES=* | |
DIR=converted | |
mkdir $DIR | |
let i=0 | |
for f in $FILES | |
do | |
if [ $f != $DIR ] && [ $f != "convert" ] | |
then | |
#name=$DIR/$i-${f%\.*}.wav | |
if [ $i -lt 10 ]; then | |
name=$DIR/0$i.wav | |
else | |
name=$DIR/$i.wav | |
fi | |
echo "$f to $name" | |
afconvert -f WAVE -d LEI16@44100 -c 1 $f $name | |
let i++ | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment