Showing the changes to python/tests/test_notes.py (1 of 1 file). Show all
Unified · Split
| @@ -1,8 +1,11 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | from numpy.testing import TestCase, assert_equal, assert_almost_equal | 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal |
| 5 | from aubio import notes | 4 | from aubio import notes, source |
| 5 | import numpy as np | ||
| 6 | from .utils import list_all_sounds | ||
| 7 | |||
| 8 | list_of_sounds = list_all_sounds('sounds') | ||
| 6 | 9 | ||
| 7 | AUBIO_DEFAULT_NOTES_SILENCE = -70. | 10 | AUBIO_DEFAULT_NOTES_SILENCE = -70. |
| 8 | AUBIO_DEFAULT_NOTES_RELEASE_DROP = 10. | 11 | AUBIO_DEFAULT_NOTES_RELEASE_DROP = 10. |
| @@ -52,14 +55,9 @@ class aubio_notes_params(TestCase): · 43 unmodified lines | |||
| 52 | with self.assertRaises(ValueError): | 55 | with self.assertRaises(ValueError): |
| 53 | self.o.set_release_drop(val) | 56 | self.o.set_release_drop(val) |
| 54 | 57 | ||
| 55 | from .utils import list_all_sounds | ||
| 56 | list_of_sounds = list_all_sounds('sounds') | ||
| 57 | |||
| 58 | class aubio_notes_sinewave(TestCase): | 58 | class aubio_notes_sinewave(TestCase): |
| 59 | 59 | ||
| 60 | def analyze_file(self, filepath, samplerate=0): | 60 | def analyze_file(self, filepath, samplerate=0): |
| 61 | from aubio import source | ||
| 62 | import numpy as np | ||
| 63 | win_s = 512 # fft size | 61 | win_s = 512 # fft size |
| 64 | hop_s = 256 # hop size | 62 | hop_s = 256 # hop size |
| 65 | 63 | ||
| @@ -92,4 +90,5 @@ class aubio_notes_sinewave(TestCase): · 26 unmodified lines | |||
| 92 | assert_equal (results[0][1], [69, 123, -1]) | 90 | assert_equal (results[0][1], [69, 123, -1]) |
| 93 | 91 | ||
| 94 | if __name__ == '__main__': | 92 | if __name__ == '__main__': |
| 93 | from unittest import main | ||
| 95 | main() | 94 | main() |