Skip to content

Instantly share code, notes, and snippets.

@RobotGrrl
Created February 21, 2012 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobotGrrl/1877360 to your computer and use it in GitHub Desktop.
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
#!/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