source: interfaces/python/test_source.py @ 577cb49

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 577cb49 was 6192ce7, checked in by Paul Brossier <piem@piem.org>, 12 years ago

test_source.py: added simple test

  • Property mode set to 100755
File size: 659 bytes
Line 
1#! /usr/bin/python
2
3from numpy.testing import TestCase, assert_equal, assert_almost_equal
4from aubio import fvec, source
5from numpy import array
6
7path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav"
8
9class aubio_filter_test_case(TestCase):
10
11  def test_members(self):
12    f = source(path)
13    print dir(f)
14
15  def test_read(self):
16    f = source(path)
17    total_frames = 0
18    while True:
19      vec, read = f()
20      total_frames += read
21      if read < f.hop_size: break
22    print "read", total_frames / float(f.samplerate), " seconds from", path
23
24if __name__ == '__main__':
25  from unittest import main
26  main()
27
Note: See TracBrowser for help on using the repository browser.