]> git.parisson.com Git - timeside.git/commitdiff
Fix bug in Vamp Simple host analyzer
authorThomas Fillon <thomas@parisson.com>
Tue, 15 Oct 2013 22:48:30 +0000 (00:48 +0200)
committerThomas Fillon <thomas@parisson.com>
Tue, 15 Oct 2013 22:48:59 +0000 (00:48 +0200)
tests/api/exempleCMMR_vamp.py
timeside/analyzer/vamp_plugin.py

index 36a03d685611110a6e286e831cfa250ba1bb5a7c..7f5864f278ad278c29a7007fb1cfa08a1623108c 100644 (file)
@@ -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)
index 5072ac50b2842fc482dbc855d25c5b373e3de54a..3e8278ca8ccb91dad0daf90bb7ef62bb2701b594 100644 (file)
@@ -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]