Created
September 20, 2014 12:55
-
-
Save atx/fcd074397cfb7d86f9c7 to your computer and use it in GitHub Desktop.
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
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