From 6192ce7bd43b9c6820bc93bacdd1d098b6ed51d1 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 13 Jul 2012 19:39:29 -0600 Subject: [PATCH] test_source.py: added simple test --- interfaces/python/test_source.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 interfaces/python/test_source.py diff --git a/interfaces/python/test_source.py b/interfaces/python/test_source.py new file mode 100755 index 00000000..8f6fbaeb --- /dev/null +++ b/interfaces/python/test_source.py @@ -0,0 +1,27 @@ +#! /usr/bin/python + +from numpy.testing import TestCase, assert_equal, assert_almost_equal +from aubio import fvec, source +from numpy import array + +path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav" + +class aubio_filter_test_case(TestCase): + + def test_members(self): + f = source(path) + print dir(f) + + def test_read(self): + f = source(path) + total_frames = 0 + while True: + vec, read = f() + total_frames += read + if read < f.hop_size: break + print "read", total_frames / float(f.samplerate), " seconds from", path + +if __name__ == '__main__': + from unittest import main + main() + -- 2.11.0