Created
October 21, 2023 01:39
-
-
Save lordjabez/bf8b55238121cb80d19261baa7f98ac8 to your computer and use it in GitHub Desktop.
Detect silence in audio files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
audio_filename="${1}" | |
silence_length="${2}" | |
ffmpeg -i "${audio_filename}" -af "silencedetect=d=${silence_length}" -f null - |& awk '/silence_end/ {print $4,$5}' | awk '{S=$2;printf "%d:%02d:%02d\n",S/(60*60),S%(60*60)/60,S%60}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment