From 3ff62e9ee5c73e45c2c95677b38202ab18820e4d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 16 Jul 2012 16:55:14 -0600 Subject: [PATCH] demo_sink.py: add simple demo --- interfaces/python/demo_sink.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 interfaces/python/demo_sink.py diff --git a/interfaces/python/demo_sink.py b/interfaces/python/demo_sink.py new file mode 100755 index 00000000..230a28de --- /dev/null +++ b/interfaces/python/demo_sink.py @@ -0,0 +1,17 @@ +#! /usr/bin/python + +import sys +from aubio import source, sink + +if __name__ == '__main__': + if len(sys.argv) < 2: + print 'usage: %s ' % sys.argv[0] + sys.exit(1) + f = source(sys.argv[1], 8000, 256) + g = sink(sys.argv[2], 8000) + total_frames, read = 0, 256 + while read: + vec, read = f() + g(vec, read) + total_frames += read + print "read", total_frames / float(f.samplerate), "seconds from", f.uri -- 2.26.2