shithub: aubio

Download patch

ref: 5314432e23a351e56ff5341adb5b6a39265b7342
parent: e1703b31d464bbf463a444ada14491478d109408
author: Paul Brossier <[email protected]>
date: Fri Jul 27 07:34:40 EDT 2012

interfaces/python/demo_source.py: use source samplerate

--- a/interfaces/python/demo_source.py
+++ b/interfaces/python/demo_source.py
@@ -7,9 +7,10 @@
   if len(sys.argv) < 2:
     print 'usage: %s <inputfile>' % 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