Mercurial > hg > jvamp
comparison test/test.java @ 41:544ee975b822
OS/X makefile
author | Chris Cannam |
---|---|
date | Mon, 28 Jan 2013 11:37:59 +0000 |
parents | c9515589be7d |
children | 2db3640905ef |
comparison
equal
deleted
inserted
replaced
40:b1036ab80767 | 41:544ee975b822 |
---|---|
30 shall not be used in advertising or otherwise to promote the sale, | 30 shall not be used in advertising or otherwise to promote the sale, |
31 use or other dealings in this Software without prior written | 31 use or other dealings in this Software without prior written |
32 authorization. | 32 authorization. |
33 */ | 33 */ |
34 | 34 |
35 import java.util.ArrayList; | |
36 import java.util.TreeMap; | |
37 import java.util.Map; | 35 import java.util.Map; |
38 import java.util.List; | 36 import java.util.List; |
39 import java.lang.RuntimeException; | 37 import java.lang.RuntimeException; |
40 | 38 |
41 import org.vamp_plugins.PluginLoader; | 39 import org.vamp_plugins.PluginLoader; |
45 import org.vamp_plugins.Feature; | 43 import org.vamp_plugins.Feature; |
46 import org.vamp_plugins.RealTime; | 44 import org.vamp_plugins.RealTime; |
47 | 45 |
48 public class test | 46 public class test |
49 { | 47 { |
50 private static void printFeatures(Map<Integer, ArrayList<Feature>> features) { | 48 private static void printFeatures(Map<Integer, List<Feature>> features) { |
51 for (Map.Entry<Integer, ArrayList<Feature>> mi : features.entrySet()) { | 49 for (Map.Entry<Integer, List<Feature>> mi : features.entrySet()) { |
52 System.out.print(mi.getKey() + ": "); | 50 System.out.print(mi.getKey() + ": "); |
53 for (Feature li : mi.getValue()) { | 51 for (Feature li : mi.getValue()) { |
54 System.out.print("[" + li.timestamp + "= "); | 52 System.out.print("[" + li.timestamp + "= "); |
55 for (float v : li.values) { | 53 for (float v : li.values) { |
56 System.out.print(v + " "); | 54 System.out.print(v + " "); |
126 if (block == 512) { | 124 if (block == 512) { |
127 buffers[0][0] = 0.5f; | 125 buffers[0][0] = 0.5f; |
128 buffers[0][1] = -0.5f; | 126 buffers[0][1] = -0.5f; |
129 } | 127 } |
130 RealTime timestamp = RealTime.frame2RealTime(block * 1024, 44100); | 128 RealTime timestamp = RealTime.frame2RealTime(block * 1024, 44100); |
131 TreeMap<Integer, ArrayList<Feature>> | 129 Map<Integer, List<Feature>> |
132 features = p.process(buffers, timestamp); | 130 features = p.process(buffers, timestamp); |
133 | 131 |
134 timestamp.dispose(); | 132 timestamp.dispose(); |
135 | 133 |
136 printFeatures(features); | 134 printFeatures(features); |
137 } | 135 } |
138 | 136 |
139 TreeMap<Integer, ArrayList<Feature>> | 137 Map<Integer, List<Feature>> |
140 features = p.getRemainingFeatures(); | 138 features = p.getRemainingFeatures(); |
141 | 139 |
142 System.out.println("Results from getRemainingFeatures:"); | 140 System.out.println("Results from getRemainingFeatures:"); |
143 | 141 |
144 printFeatures(features); | 142 printFeatures(features); |