Create a gist now

Instantly share code, notes, and snippets.

import scipy.io.wavfile
import sys
for fname in sys.argv[1:]:
rate, data = scipy.io.wavfile.read(fname)
silence = 0
for x in data:
if x and silence:
print(silence)
silence = 0
elif not x:
silence += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment