feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 927f630 was
25c9f9a,
checked in by Paul Brossier <piem@piem.org>, 12 years ago
|
move new python module to the top
|
-
Property mode set to
100755
|
File size:
663 bytes
|
Rev | Line | |
---|
[75e715f] | 1 | #! /usr/bin/env python |
---|
[6192ce7] | 2 | |
---|
| 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal |
---|
| 4 | from aubio import fvec, source |
---|
| 5 | from numpy import array |
---|
| 6 | |
---|
| 7 | path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav" |
---|
| 8 | |
---|
| 9 | class 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 | |
---|
| 24 | if __name__ == '__main__': |
---|
| 25 | from unittest import main |
---|
| 26 | main() |
---|
| 27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.