Skip to content

Instantly share code, notes, and snippets.

@atx
Created September 20, 2014 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atx/fcd074397cfb7d86f9c7 to your computer and use it in GitHub Desktop.
Save atx/fcd074397cfb7d86f9c7 to your computer and use it in GitHub Desktop.
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