Changeset 11c0d74
- Timestamp:
- Nov 17, 2018, 8:20:45 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- a114fe0
- Parents:
- b41672c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_onset.py
rb41672c r11c0d74 3 3 from unittest import main 4 4 from numpy.testing import TestCase, assert_equal, assert_almost_equal 5 from aubio import onset 5 from aubio import onset, fvec 6 6 7 7 class aubio_onset_default(TestCase): … … 84 84 samplerate = 8000 85 85 86 class aubio_onset_coverate(TestCase): 87 # extra tests to execute the C routines and improve coverage 88 89 def test_all_methods(self): 90 for method in ['default', 'energy', 'hfc', 'complexdomain', 'complex', 91 'phase', 'wphase', 'mkl', 'kl', 'specflux', 'specdiff', 92 'old_default']: 93 o = onset(method=method, buf_size=512, hop_size=256) 94 o(fvec(256)) 95 96 def test_get_methods(self): 97 o = onset(method='default', buf_size=512, hop_size=256) 98 99 assert o.get_silence() == -70 100 o.set_silence(-20) 101 assert_almost_equal(o.get_silence(), -20) 102 103 assert o.get_compression() == 1 104 o.set_compression(.99) 105 assert_almost_equal(o.get_compression(), .99) 106 107 assert o.get_awhitening() == 0 108 o.set_awhitening(1) 109 assert o.get_awhitening() == 1 110 111 o.get_last() 112 o.get_last_ms() 113 o.get_last_s() 114 o.get_descriptor() 115 o.get_thresholded_descriptor() 116 117 86 118 if __name__ == '__main__': 87 119 main()
Note: See TracChangeset
for help on using the changeset viewer.