[031b1f9] | 1 | from template import * |
---|
| 2 | |
---|
| 3 | class aubioonset_test_case(program_test_case): |
---|
| 4 | |
---|
| 5 | import os.path |
---|
| 6 | filename = os.path.join('..','..','sounds','woodblock.aiff') |
---|
| 7 | progname = os.path.join('..','..','examples','aubioonset') |
---|
| 8 | |
---|
| 9 | def test_aubioonset(self): |
---|
| 10 | """ test aubioonset with default parameters """ |
---|
| 11 | self.getOutput() |
---|
| 12 | |
---|
| 13 | def test_aubioonset_with_inf_silence(self): |
---|
| 14 | """ test aubioonset with -s 0 """ |
---|
| 15 | self.command += " -s 0" |
---|
| 16 | self.getOutput() |
---|
| 17 | assert len(self.output) == 0, self.output |
---|
| 18 | |
---|
| 19 | def test_aubioonset_with_no_silence(self): |
---|
| 20 | """ test aubioonset with -s -100 """ |
---|
| 21 | self.command += " -s -100 " |
---|
| 22 | self.getOutput() |
---|
| 23 | # only one onset in woodblock.aiff |
---|
| 24 | assert len(self.output.split('\n')) == 1 |
---|
| 25 | assert len(str(self.output)) != 0, "no output produced with command:\n" + self.command |
---|
| 26 | # onset should be at 0.00000 |
---|
| 27 | assert float(self.output.strip()) == 0. |
---|
| 28 | |
---|
| 29 | class aubioonset_test_case_energy(aubioonset_test_case): |
---|
| 30 | def setUp(self, options = " -O energy "): |
---|
| 31 | aubioonset_test_case.setUp(self, options = options) |
---|
| 32 | |
---|
| 33 | class aubioonset_test_case_specdiff(aubioonset_test_case): |
---|
| 34 | def setUp(self, options = " -O specdiff "): |
---|
| 35 | aubioonset_test_case.setUp(self, options = options) |
---|
| 36 | |
---|
| 37 | class aubioonset_test_case_hfc(aubioonset_test_case): |
---|
| 38 | def setUp(self, options = " -O hfc "): |
---|
| 39 | aubioonset_test_case.setUp(self, options = options) |
---|
| 40 | |
---|
| 41 | class aubioonset_test_case_complex(aubioonset_test_case): |
---|
| 42 | def setUp(self, options = " -O complex "): |
---|
| 43 | aubioonset_test_case.setUp(self, options = options) |
---|
| 44 | |
---|
| 45 | class aubioonset_test_case_phase(aubioonset_test_case): |
---|
| 46 | def setUp(self, options = " -O phase "): |
---|
| 47 | aubioonset_test_case.setUp(self, options = options) |
---|
| 48 | |
---|
| 49 | class aubioonset_test_case_kl(aubioonset_test_case): |
---|
| 50 | def setUp(self, options = " -O kl "): |
---|
| 51 | aubioonset_test_case.setUp(self, options = options) |
---|
| 52 | |
---|
| 53 | class aubioonset_test_case_mkl(aubioonset_test_case): |
---|
| 54 | def setUp(self, options = " -O mkl "): |
---|
| 55 | aubioonset_test_case.setUp(self, options = options) |
---|
| 56 | |
---|
| 57 | if __name__ == '__main__': |
---|
| 58 | unittest.main() |
---|