Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- outputDir=output
- if [ ! -d $outputDir ]
- then
- mkdir -p $outputDir
- fi
- #only do this if there are .WAV files vs. .wav files.
- count=`ls -1 *.WAV 2>/dev/null | wc -l`
- if [ $count != 0 ]
- then
- for infileBig in *.WAV
- do
- outfile=`basename "$infileBig" .WAV`.wav
- echo "Renaming $infileBig to $outifile"
- mv "$infileBig" "$outfile"
- done
- fi
- #check for .wav and then run
- countwav=`ls -1 *.wav 2>/dev/null | wc -l`
- if [ $countwav != 0 ]
- then
- for infile in *.wav
- do
- echo "Processing "$infile
- sox "$infile" -r 8k -c 1 -e mu-law -b 8 "$outputDir/$infile" rate 8k
- done
- else
- echo "No '.wav' files available to process."
- fi
Advertisement
Add Comment
Please, Sign In to add comment