Mercurial > hg > vampy-host
diff vamp/process.py @ 112:9343eee50605
Update to Python 3. Currently crashes during tests (and also, two tests are now failing, even with Py2).
author | Chris Cannam |
---|---|
date | Wed, 17 Jun 2015 12:35:41 +0100 |
parents | 72be91c3cb3d |
children | 2370b942cd32 |
line wrap: on
line diff
--- a/vamp/process.py Wed Jun 17 11:04:15 2015 +0100 +++ b/vamp/process.py Wed Jun 17 12:35:41 2015 +0100 @@ -1,8 +1,8 @@ '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import vampyhost -import frames -import load +import vamp.frames +import vamp.load def process_with_initialised_plugin(ff, sample_rate, step_size, plugin, outputs): @@ -30,7 +30,7 @@ yield { o: r } -def process(data, sample_rate, key, output = "", parameters = {}): +def process_audio(data, sample_rate, key, output = "", parameters = {}): """Process audio data with a Vamp plugin, and make the results from a single plugin output available as a generator. @@ -57,12 +57,12 @@ structure, consider using vamp.collect() instead. """ - plugin, step_size, block_size = load.load_and_configure(data, sample_rate, key, parameters) + plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, key, parameters) if output == "": output = plugin.get_output(0)["identifier"] - ff = frames.frames_from_array(data, step_size, block_size) + ff = vamp.frames.frames_from_array(data, step_size, block_size) for r in process_with_initialised_plugin(ff, sample_rate, step_size, plugin, [output]): yield r[output] @@ -164,9 +164,9 @@ array of float values. """ - plugin, step_size, block_size = load.load_and_configure(data, sample_rate, key, parameters) + plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, key, parameters) - ff = frames.frames_from_array(data, step_size, block_size) + ff = vamp.frames.frames_from_array(data, step_size, block_size) for r in process_with_initialised_plugin(ff, sample_rate, step_size, plugin, outputs): yield r