workaround to avoid crashing on silence cut
authorPaul Brossier <piem@altern.org>
Mon, 20 Feb 2006 11:34:25 +0000 (11:34 +0000)
committerPaul Brossier <piem@altern.org>
Mon, 20 Feb 2006 11:34:25 +0000 (11:34 +0000)
workaround to avoid crashing on silence cut

python/aubiocut

index d3bbe64..b9533b5 100755 (executable)
@@ -108,7 +108,8 @@ for i in range(len(modes)):
                params.storefunc=False
        filetask = dotask(filename,params=params)
        onsets = filetask.compute_all()
-       ofunc = filetask.ofunc
+       if not options.silencecut:
+               ofunc = filetask.ofunc
         #onsets, ofunc = getonsets(filename,threshold,silence,
         #        mode=mode[i],localmin=options.localmin,
         #        derivate=options.derivate,
@@ -131,7 +132,8 @@ for i in range(len(modes)):
                 onsets = newonsets
 
         lonsets.append(onsets)
-        lofunc.append(ofunc)
+       if not options.silencecut:
+               lofunc.append(ofunc)
 
        # print times in second
        if options.verbose: