Skip to content

Instantly share code, notes, and snippets.

@nietaki
Created March 6, 2020 23:08
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 nietaki/310544f40495cfb8f518101cbf19e814 to your computer and use it in GitHub Desktop.
Save nietaki/310544f40495cfb8f518101cbf19e814 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo 'missing directory'
exit 1
fi
dir="$1"
for filename in $dir/*.wav; do
mkdir -p "$dir/trimmed"
echo "$filename"
sox "$filename" "$dir/trimmed/$filename" silence 1 0.1 0.00000001% 1 0.1 0.01%
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment