Skip to content

Instantly share code, notes, and snippets.

@jochemstoel
Forked from VojtechKlos/split_silence.sh
Created December 26, 2017 11:24
Show Gist options
  • Save jochemstoel/05a4ac5337b829b023feb73ef97a31ed to your computer and use it in GitHub Desktop.
Save jochemstoel/05a4ac5337b829b023feb73ef97a31ed to your computer and use it in GitHub Desktop.
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
# Split audio by noise
sox -V3 clean.wav output.wav silence 1 0.2 0.4% 1 0.2 0.4% : newfile : restart
####### (these settings worked for my computer mic - maybe we need to finetune them later) #######
@johnpankowicz
Copy link

johnpankowicz commented Feb 5, 2019

Thank you! I just used this to split an album that had been recorded as a single file. I just needed to increase the silence durations from 0.2 to 0.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment