Skip to content

Instantly share code, notes, and snippets.

@leonmak
Created February 7, 2018 19:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonmak/725ae49a7aa750d0f2962eefcd7832e5 to your computer and use it in GitHub Desktop.
Save leonmak/725ae49a7aa750d0f2962eefcd7832e5 to your computer and use it in GitHub Desktop.
Convert format of all audio files in folder with sox
#!/bin/bash
outputdir="../audio-8k"
mkdir -p $outputdir
for file in **/*.wav
do
filename=$(basename $file)
dir=$(dirname $file)
echo $dir
outputfile="${outputdir}/${file}"
mkdir -p $(dirname $outputfile)
sox $file -r 8000 $outputfile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment