Changeset d06c9a4


Ignore:
Timestamp:
Nov 17, 2018, 10:21:30 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
bf3f09b
Parents:
ff28d81 (diff), a114fe0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/pytest

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_filter.py

    rff28d81 rd06c9a4  
    7777            f.set_biquad(0., 0., 0, 0., 0.)
    7878
     79    def test_all_available_presets(self):
     80        f = digital_filter(7)
     81        for sr in [8000, 11025, 16000, 22050, 24000, 32000,
     82                44100, 48000, 88200, 96000, 192000]:
     83            f.set_a_weighting(sr)
     84        f = digital_filter(5)
     85        for sr in [8000, 11025, 16000, 22050, 24000, 32000,
     86                44100, 48000, 88200, 96000, 192000]:
     87            f.set_c_weighting(sr)
     88
    7989class aubio_filter_wrong_params(TestCase):
    8090
  • python/tests/test_onset.py

    rff28d81 rd06c9a4  
    22
    33from numpy.testing import TestCase, assert_equal, assert_almost_equal
    4 from aubio import onset
     4from aubio import onset, fvec
    55
    66class aubio_onset_default(TestCase):
     
    8383    samplerate = 8000
    8484
     85class aubio_onset_coverate(TestCase):
     86    # extra tests to execute the C routines and improve coverage
     87
     88    def test_all_methods(self):
     89        for method in ['default', 'energy', 'hfc', 'complexdomain', 'complex',
     90                'phase', 'wphase', 'mkl', 'kl', 'specflux', 'specdiff',
     91                'old_default']:
     92            o = onset(method=method, buf_size=512, hop_size=256)
     93            o(fvec(256))
     94
     95    def test_get_methods(self):
     96        o = onset(method='default', buf_size=512, hop_size=256)
     97
     98        assert o.get_silence() == -70
     99        o.set_silence(-20)
     100        assert_almost_equal(o.get_silence(), -20)
     101
     102        assert o.get_compression() == 1
     103        o.set_compression(.99)
     104        assert_almost_equal(o.get_compression(), .99)
     105
     106        assert o.get_awhitening() == 0
     107        o.set_awhitening(1)
     108        assert o.get_awhitening() == 1
     109
     110        o.get_last()
     111        o.get_last_ms()
     112        o.get_last_s()
     113        o.get_descriptor()
     114        o.get_thresholded_descriptor()
     115
     116
    85117if __name__ == '__main__':
    86118    from unittest import main
  • tests/src/temporal/test-filter.c

    rff28d81 rd06c9a4  
    99
    1010  aubio_filter_t *o = new_aubio_filter_c_weighting (44100);
     11
     12  if (new_aubio_filter(0))
     13    return 1;
     14
     15  if (aubio_filter_get_samplerate(o) != 44100)
     16    return 1;
     17
     18  if (aubio_filter_set_c_weighting (o, -1) == 0)
     19    return 1;
     20
     21  if (aubio_filter_set_c_weighting (0, 32000) == 0)
     22    return 1;
     23
    1124  in->data[impulse_at] = 0.5;
    1225  fvec_print (in);
     
    1629
    1730  o = new_aubio_filter_a_weighting (32000);
     31
     32  if (aubio_filter_set_a_weighting (o, -1) == 0)
     33    return 1;
     34  if (aubio_filter_set_a_weighting (0, 32000) == 0)
     35    return 1;
     36
    1837  in->data[impulse_at] = 0.5;
    1938  fvec_print (in);
Note: See TracChangeset for help on using the changeset viewer.