Mercurial > hg > vampy-host
comparison vamp/collect.py @ 140:1a494598ee2b
Support step size, block size, process timestamp method kwargs
author | Chris Cannam |
---|---|
date | Wed, 08 Jul 2015 12:46:04 +0100 |
parents | b8fe675f9c3f |
children | 79b050ca2fc2 |
comparison
equal
deleted
inserted
replaced
139:aa96f69e2f14 | 140:1a494598ee2b |
---|---|
106 rv = list(fill_timestamps(results, sample_rate, step_size, output_desc)) | 106 rv = list(fill_timestamps(results, sample_rate, step_size, output_desc)) |
107 | 107 |
108 return rv | 108 return rv |
109 | 109 |
110 | 110 |
111 def collect(data, sample_rate, plugin_key, output = "", parameters = {}): | 111 def collect(data, sample_rate, plugin_key, output = "", parameters = {}, **kwargs): |
112 """Process audio data with a Vamp plugin, and make the results from a | 112 """Process audio data with a Vamp plugin, and make the results from a |
113 single plugin output available as a single structure. | 113 single plugin output available as a single structure. |
114 | 114 |
115 The provided data should be a 1- or 2-dimensional list or NumPy | 115 The provided data should be a 1- or 2-dimensional list or NumPy |
116 array of floats. If it is 2-dimensional, the first dimension is | 116 array of floats. If it is 2-dimensional, the first dimension is |
156 plugin returns them, via an asynchronous generator function, use | 156 plugin returns them, via an asynchronous generator function, use |
157 vamp.process() instead. | 157 vamp.process() instead. |
158 | 158 |
159 """ | 159 """ |
160 | 160 |
161 plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters) | 161 plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters, **kwargs) |
162 | 162 |
163 if output == "": | 163 if output == "": |
164 output_desc = plugin.get_output(0) | 164 output_desc = plugin.get_output(0) |
165 output = output_desc["identifier"] | 165 output = output_desc["identifier"] |
166 else: | 166 else: |