comparison vamp/collect.py @ 100:72be91c3cb3d

Add & test process_frames_multiple_outputs
author Chris Cannam
date Tue, 10 Feb 2015 10:56:44 +0000
parents 7764eb74a3c6
children 0c5a4dc04ed9
comparison
equal deleted inserted replaced
99:7764eb74a3c6 100:72be91c3cb3d
121 If you would prefer to obtain features as they are calculated 121 If you would prefer to obtain features as they are calculated
122 (where the plugin supports this) and with the format in which the 122 (where the plugin supports this) and with the format in which the
123 plugin returns them, via an asynchronous generator function, use 123 plugin returns them, via an asynchronous generator function, use
124 vamp.process() instead. 124 vamp.process() instead.
125 """ 125 """
126 126
127 plugin, step_size, block_size = load.load_and_configure(data, sample_rate, key, parameters) 127 plugin, step_size, block_size = load.load_and_configure(data, sample_rate, key, parameters)
128 128
129 if output == "": 129 if output == "":
130 output_desc = plugin.get_output(0) 130 output_desc = plugin.get_output(0)
131 output = output_desc["identifier"] 131 output = output_desc["identifier"]
132 else: 132 else:
133 output_desc = plugin.get_output(output) 133 output_desc = plugin.get_output(output)
134 134
135 ff = frames.frames_from_array(data, step_size, block_size) 135 ff = frames.frames_from_array(data, step_size, block_size)
136 136
137 results = process.process_frames_with_plugin(ff, sample_rate, step_size, plugin, [output]) 137 results = process.process_with_initialised_plugin(ff, sample_rate, step_size, plugin, [output])
138 138
139 rv = reshape(results, sample_rate, step_size, output_desc) 139 rv = reshape(results, sample_rate, step_size, output_desc)
140 140
141 plugin.unload() 141 plugin.unload()
142 return rv 142 return rv