Mercurial > hg > jvamp
diff org/vamp_plugins/test.java @ 17:9c108ad04e9b
Test process(). Now crashes
author | Chris Cannam |
---|---|
date | Mon, 06 Feb 2012 18:01:58 +0000 |
parents | d8b5d8c39813 |
children | 530bf5009ee2 |
line wrap: on
line diff
--- a/org/vamp_plugins/test.java Mon Feb 06 17:35:26 2012 +0000 +++ b/org/vamp_plugins/test.java Mon Feb 06 18:01:58 2012 +0000 @@ -42,10 +42,22 @@ System.out.println(i + ": " + outputs[i].identifier + " (sample type: " + outputs[i].sampleType + ")"); } - boolean b = p.initialise(1, 512, 1024); + boolean b = p.initialise(1, 0, 1024); System.out.println("Plugin initialise returned " + b); - //!!! todo: test process! + float[][] buffers = new float[1][1024]; + for (int block = 0; block < 1024; ++block) { + for (int i = 0; i < 1024; ++i) { + buffers[0][i] = 0.0f; + } + if (block == 512) { + buffers[0][0] = 1.0f; + } + RealTime timestamp = RealTime.frame2RealTime(block * 1024, 44100); + TreeMap<Integer, ArrayList<Plugin.Feature>> + features = p.process(buffers, timestamp); + System.out.println("Plugin process returned features on " + features.size() + " different output(s)"); + } TreeMap<Integer, ArrayList<Plugin.Feature>> features = p.getRemainingFeatures();