From: Thomas Fillon Date: Tue, 15 Oct 2013 22:48:30 +0000 (+0200) Subject: Fix bug in Vamp Simple host analyzer X-Git-Tag: 0.5.0~15 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c9e1dbc9e7bc722dddf745655380534f911a98a2;p=timeside.git Fix bug in Vamp Simple host analyzer --- diff --git a/tests/api/exempleCMMR_vamp.py b/tests/api/exempleCMMR_vamp.py index 36a03d6..7f5864f 100644 --- a/tests/api/exempleCMMR_vamp.py +++ b/tests/api/exempleCMMR_vamp.py @@ -12,7 +12,7 @@ import numpy as np import sys #wav_file = sys.argv[-1] -wav_file = '/home/thomas/code/timeside/voix.wav' +wav_file = '/home/thomas/code/timeside/TimeSide/tests/samples/sweep.wav' # normal d = timeside.decoder.FileDecoder(wav_file) diff --git a/timeside/analyzer/vamp_plugin.py b/timeside/analyzer/vamp_plugin.py index 5072ac5..3e8278c 100644 --- a/timeside/analyzer/vamp_plugin.py +++ b/timeside/analyzer/vamp_plugin.py @@ -72,6 +72,8 @@ class VampSimpleHost(Analyzer): plugin = ':'.join(plugin_line) (time, duration, value) = self.vamp_plugin(plugin, wavfile) + if value is None: + return if duration is not None: plugin_res = self.new_result(data_mode='value', time_mode='segment') @@ -120,6 +122,9 @@ class VampSimpleHost(Analyzer): stderr = stdout[0:8] # stderr containing file and process information res = stdout[8:] # stdout containg the feature data + if len(res) == 0: + return + # Parse stderr to get blocksize and stepsize blocksize_info = stderr[4]