- Timestamp:
- Dec 3, 2007, 10:57:52 AM (16 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- 45f1f06
- Parents:
- dddf1f5 (diff), 6913434 (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. - Location:
- tests
- Files:
-
- 13 added
- 3 edited
- 17 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/demo/plot_mfcc_filterbank.py
rdddf1f5 r212da72 5 5 import sys 6 6 7 from aubio.aubiowrapper import *7 from localaubio import * 8 8 9 9 win_size = 2048 … … 14 14 filterbank = new_aubio_filterbank_mfcc(n_filters, win_size, samplerate, 15 15 0., samplerate) 16 17 16 18 17 mfcc_filters = [] -
tests/python/examples/aubioonset.py
rdddf1f5 r212da72 1 1 from template import * 2 2 3 class aubioonset_ test_case(program_test_case):3 class aubioonset_unit(program_test_case): 4 4 5 5 import os.path … … 24 24 self.getOutput() 25 25 # only one onset in woodblock.aiff 26 assert len(str(self.output)) != 0, "no output produced with command:\n"\27 + self.command28 assert len(self.output.split('\n')) == 126 self.assertNotEqual(0, len(str(self.output)), \ 27 "no output produced with command:\n" + self.command) 28 self.assertEqual(1, len(self.output.split('\n')) ) 29 29 # onset should be at 0.00000 30 assert float(self.output.strip()) == 0.30 self.assertEqual(0, float(self.output.strip())) 31 31 32 for name in ["energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl"]: 33 exec("class aubioonset_test_case_"+name+"(aubioonset_test_case):\n\ 32 list_of_onset_modes = ["energy", "specdiff", "hfc", "complex", "phase", \ 33 "kl", "mkl", "specflux"] 34 35 for name in list_of_onset_modes: 36 exec("class aubioonset_"+name+"_unit(aubioonset_unit):\n\ 34 37 options = \" -O "+name+" \"") 35 38 -
tests/python/run_all_tests
rdddf1f5 r212da72 1 1 #! /usr/bin/python 2 3 # add ${src}/python and ${src}/python/aubio/.libs to python path4 # so the script is runnable from a compiled source tree.5 import sys, os6 7 cur_dir = os.path.dirname(sys.argv[0])8 sys.path.append(os.path.join(cur_dir,'..','..','python'))9 sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))10 2 11 3 import unittest … … 15 7 return [i.split('.')[0].replace('/','.') for i in glob(path)] 16 8 17 modules_to_test = list_of_test_files('*.py') 9 modules_to_test = [] 10 modules_to_test += list_of_test_files('src/*.py') 11 modules_to_test += list_of_test_files('src/*/*.py') 18 12 modules_to_test += list_of_test_files('examples/aubio*.py') 13 modules_to_test += list_of_test_files('*.py') 19 14 20 15 if __name__ == '__main__': -
tests/python/src/cvec.py
rdddf1f5 r212da72 1 import unittest 2 3 from aubio.aubiowrapper import * 1 from template import aubio_unit_template 2 from localaubio import * 4 3 5 4 buf_size = 2048 6 5 channels = 3 7 6 8 class cvec_ test_case(unittest.TestCase):7 class cvec_unit(aubio_unit_template): 9 8 10 9 def setUp(self): -
tests/python/src/fvec.py
rdddf1f5 r212da72 1 import unittest 2 3 from aubio.aubiowrapper import * 1 from template import aubio_unit_template 2 from localaubio import * 4 3 5 4 buf_size = 2048 6 5 channels = 3 7 6 8 class fvec_ test_case(unittest.TestCase):7 class fvec_unit(aubio_unit_template): 9 8 10 9 def setUp(self): -
tests/python/src/spectral/filterbank.py
rdddf1f5 r212da72 92 92 def testmfcc_channels(self): 93 93 """ check the values of each filters in the mfcc filterbank """ 94 import os.path 94 95 self.filterbank = new_aubio_filterbank_mfcc(n_filters, win_size, samplerate, 95 96 0., samplerate) 96 97 filterbank_mfcc = [ [float(f) for f in line.strip().split()] 97 for line in open( 'filterbank_mfcc.txt').readlines()]98 for line in open(os.path.join('src','spectral','filterbank_mfcc.txt')).readlines()] 98 99 for channel in range(n_filters): 99 100 vec = aubio_filterbank_getchannel(self.filterbank,channel) -
tests/python/template.py
rdddf1f5 r212da72 1 2 1 import unittest 3 2 … … 5 4 6 5 def assertCloseEnough(self, first, second, places=5, msg=None): 7 8 9 10 11 12 13 14 15 16 17 18 6 """Fail if the two objects are unequal as determined by their 7 *relative* difference rounded to the given number of decimal places 8 (default 7) and comparing to zero. 9 """ 10 if round(first, places) == 0: 11 if round(second-first, places) != 0: 12 raise self.failureException, \ 13 (msg or '%r != %r within %r places' % (first, second, places)) 14 else: 15 if round((second-first)/first, places) != 0: 16 raise self.failureException, \ 17 (msg or '%r != %r within %r places' % (first, second, places))
Note: See TracChangeset
for help on using the changeset viewer.