source: tests/python/examples/aubioonset.py @ 031b1f9

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 031b1f9 was 031b1f9, checked in by Paul Brossier <piem@piem.org>, 16 years ago

added examples tests

  • Property mode set to 100644
File size: 2.0 KB
Line 
1from template import *
2
3class 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
29class aubioonset_test_case_energy(aubioonset_test_case):
30  def setUp(self, options = " -O energy "):
31    aubioonset_test_case.setUp(self, options = options)
32
33class aubioonset_test_case_specdiff(aubioonset_test_case):
34  def setUp(self, options = " -O specdiff "):
35    aubioonset_test_case.setUp(self, options = options)
36
37class aubioonset_test_case_hfc(aubioonset_test_case):
38  def setUp(self, options = " -O hfc "):
39    aubioonset_test_case.setUp(self, options = options)
40
41class aubioonset_test_case_complex(aubioonset_test_case):
42  def setUp(self, options = " -O complex "):
43    aubioonset_test_case.setUp(self, options = options)
44
45class aubioonset_test_case_phase(aubioonset_test_case):
46  def setUp(self, options = " -O phase "):
47    aubioonset_test_case.setUp(self, options = options)
48
49class aubioonset_test_case_kl(aubioonset_test_case):
50  def setUp(self, options = " -O kl "):
51    aubioonset_test_case.setUp(self, options = options)
52
53class aubioonset_test_case_mkl(aubioonset_test_case):
54  def setUp(self, options = " -O mkl "):
55    aubioonset_test_case.setUp(self, options = options)
56
57if __name__ == '__main__':
58  unittest.main()
Note: See TracBrowser for help on using the repository browser.