From c9e1dbc9e7bc722dddf745655380534f911a98a2 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Wed, 16 Oct 2013 00:48:30 +0200 Subject: [PATCH] Fix bug in Vamp Simple host analyzer --- tests/api/exempleCMMR_vamp.py | 2 +- timeside/analyzer/vamp_plugin.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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] -- 2.39.5