source: python/test_source.py @ 25c9f9a

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

move new python module to the top

  • Property mode set to 100755
File size: 663 bytes
Line 
1#! /usr/bin/env 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.