From: Paul Brossier Date: Fri, 27 Jul 2012 17:34:40 +0000 (-0600) Subject: interfaces/python/demo_source.py: use source samplerate X-Git-Tag: 0.4.0-beta1~336 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=5314432e23a351e56ff5341adb5b6a39265b7342;p=aubio.git interfaces/python/demo_source.py: use source samplerate --- diff --git a/interfaces/python/demo_source.py b/interfaces/python/demo_source.py index 5c91236e..d4f9de10 100755 --- a/interfaces/python/demo_source.py +++ b/interfaces/python/demo_source.py @@ -7,9 +7,10 @@ if __name__ == '__main__': if len(sys.argv) < 2: print 'usage: %s ' % sys.argv[0] sys.exit(1) - f = source(sys.argv[1], 8000, 256) + f = source(sys.argv[1], 1, 256) + samplerate = f.get_samplerate() total_frames, read = 0, 256 while read: vec, read = f() total_frames += read - print "read", total_frames / float(f.samplerate), "seconds from", f.uri + print "read", total_frames / float(samplerate), "seconds from", f.uri