python/aubio/aubioclass.py: update peakpicker usage
authorPaul Brossier <piem@piem.org>
Sun, 18 Oct 2009 13:20:00 +0000 (15:20 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 18 Oct 2009 13:20:00 +0000 (15:20 +0200)
python/aubio/aubioclass.py

index 530fa4b8d9381f2a36bb3bb816803f14c9886a2b..f9a1022b39ae38f074d167f8ed14ee269e9298d4 100644 (file)
@@ -79,9 +79,12 @@ class onsetdetection:
 class peakpick:
     """ class for aubio_peakpicker """
     def __init__(self,threshold=0.1):
-        self.pp = new_aubio_peakpicker(threshold)
+        self.pp = new_aubio_peakpicker(1)
+        self.out = new_fvec(1, 1)
+        aubio_peakpicker_set_threshold (self.pp, threshold)
     def do(self,fv):
-        return aubio_peakpicker_do(self.pp, fv())
+        aubio_peakpicker_do(self.pp, fv(), self.out)
+        return fvec_read_sample(self.out, 0, 0)
     def getval(self):
         return aubio_peakpicker_get_adaptive_threshold(self.pp)
     def __del__(self):