Skip to content

Commit

Permalink
Update silence.py
Browse files Browse the repository at this point in the history
Changed silence thresholding from < to <=.
With < there is no way to threshold for absolute silence (-inf dB) only.
  • Loading branch information
sceller authored Nov 17, 2017
1 parent 2acd548 commit 081f34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydub/silence.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def detect_silence(audio_segment, min_silence_len=1000, silence_thresh=-16, seek

for i in slice_starts:
audio_slice = audio_segment[i:i + min_silence_len]
if audio_slice.rms < silence_thresh:
if audio_slice.rms <= silence_thresh:
silence_starts.append(i)

# short circuit when there is no silence
Expand Down

0 comments on commit 081f34e

Please sign in to comment.