comparison test/test_process.py @ 100:72be91c3cb3d

Add & test process_frames_multiple_outputs
author Chris Cannam
date Tue, 10 Feb 2015 10:56:44 +0000
parents f0c18ba7b54e
children 0c5a4dc04ed9
comparison
equal deleted inserted replaced
99:7764eb74a3c6 100:72be91c3cb3d
90 assert actual == expected 90 assert actual == expected
91 91
92 def test_process_multi_summary(): 92 def test_process_multi_summary():
93 buf = input_data(blocksize * 10) 93 buf = input_data(blocksize * 10)
94 results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], {})) 94 results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], {}))
95 assert len(results) == 10
96 for i in range(len(results)):
97 #
98 # each feature has a single value, equal to the number of non-zero elts
99 # in the input block (which is all of them, i.e. the blocksize) plus
100 # the first elt (which is i * blockSize + 1)
101 #
102 expected = blocksize + i * blocksize + 1
103 actual = results[i]["input-summary"]["values"][0]
104 assert actual == expected
105
106 def test_process_multi_summary_frames():
107 buf = input_data(blocksize * 10)
108 ff = fr.frames_from_array(buf, blocksize, blocksize)
109 results = list(vamp.process_frames_multiple_outputs(ff, rate, blocksize, plugin_key, [ "input-summary" ], {}))
95 assert len(results) == 10 110 assert len(results) == 10
96 for i in range(len(results)): 111 for i in range(len(results)):
97 # 112 #
98 # each feature has a single value, equal to the number of non-zero elts 113 # each feature has a single value, equal to the number of non-zero elts
99 # in the input block (which is all of them, i.e. the blocksize) plus 114 # in the input block (which is all of them, i.e. the blocksize) plus