Chris@71: Chris@71: import vamp Chris@71: import numpy as np Chris@71: Chris@82: plugin_key = "vamp-test-plugin:vamp-test-plugin" Chris@82: plugin_key_freq = "vamp-test-plugin:vamp-test-plugin-freq" Chris@71: Chris@71: rate = 44100 Chris@71: Chris@71: # Throughout this file we have the assumption that the plugin gets run with a Chris@71: # blocksize of 1024, and with a step of 1024 for the time-domain version or 512 Chris@71: # for the frequency-domain one. That is certainly expected to be the norm for a Chris@71: # plugin like this that declares no preference, and the Python Vamp module is Chris@71: # expected to follow the norm Chris@71: Chris@71: blocksize = 1024 Chris@71: Chris@71: def input_data(n): Chris@71: # start at 1, not 0 so that all elts are non-zero Chris@71: return np.arange(n) + 1 Chris@71: Chris@71: def test_collect_runs_at_all(): Chris@71: buf = input_data(blocksize) Chris@82: results = vamp.collect(buf, rate, plugin_key, {}, "input-summary") Chris@71: assert type(results) == dict