projects
/
aubio.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
examples/utils.c: exit if an output file could not be opened
[aubio.git]
/
python
/
demos
/
demo_source.py
1
#! /usr/bin/env python
2
3
import sys
4
from aubio import source
5
6
if __name__ == '__main__':
7
if len(sys.argv) < 2:
8
print 'usage: %s <inputfile>' % sys.argv[0]
9
sys.exit(1)
10
f = source(sys.argv[1], 8000, 256)
11
total_frames, read = 0, 256
12
while read:
13
vec, read = f()
14
total_frames += read
15
print "read", total_frames / float(f.samplerate), "seconds from", f.uri