From 9f07d52148a0c25c53eabc3521e29464013107b4 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 18 Oct 2009 15:20:00 +0200 Subject: [PATCH] python/aubio/aubioclass.py: update peakpicker usage --- python/aubio/aubioclass.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/aubio/aubioclass.py b/python/aubio/aubioclass.py index 530fa4b8..f9a1022b 100644 --- a/python/aubio/aubioclass.py +++ b/python/aubio/aubioclass.py @@ -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): -- 2.26.2