view test/test_collect.py @ 71:cb0380c92c42

Stub out a collect() function which will (?) assemble a suitable structure from an entire run
author Chris Cannam
date Wed, 14 Jan 2015 17:33:16 +0000
parents
children a11b57e9fb0b
line wrap: on
line source

import vamp
import numpy as np

testPluginKey = "vamp-test-plugin:vamp-test-plugin"
testPluginKeyFreq = "vamp-test-plugin:vamp-test-plugin-freq"

rate = 44100

# Throughout this file we have the assumption that the plugin gets run with a
# blocksize of 1024, and with a step of 1024 for the time-domain version or 512
# for the frequency-domain one. That is certainly expected to be the norm for a
# plugin like this that declares no preference, and the Python Vamp module is
# expected to follow the norm

blocksize = 1024

def input_data(n):
    # start at 1, not 0 so that all elts are non-zero
    return np.arange(n) + 1    

def test_collect_runs_at_all():
    buf = input_data(blocksize)
    results = vamp.collect(buf, rate, testPluginKey, {}, "input-summary")
    assert type(results) == dict