Skip to content

Instantly share code, notes, and snippets.

@acetylSv
Created April 4, 2019 13:48
Show Gist options
  • Save acetylSv/b31fe9a34ff3ce1a1ccea93aefded214 to your computer and use it in GitHub Desktop.
Save acetylSv/b31fe9a34ff3ce1a1ccea93aefded214 to your computer and use it in GitHub Desktop.
silence segmentation using auditok
for var in $@
do
# for auditok to process a file
# -e : energy threshlod
# -d : discard silence period
# -s : min-length of a continuos silence
# -n : min-length of a segment
# -m : max-length of a segment
# -M : only process the first M seconds of the file
echo "processing file : $var"
mkdir ${var/.wav}
auditok -i $var -o "${var/.wav}"_seg_{N}.wav -d -e 50 -n 1 -m 15
for num in $(seq 1 500)
do
file="${var/.wav}"_seg_"${num}".wav
if [ -f "$file" ]
then
mv "$file" ${var/.wav}
fi
done
done
echo "Process done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment