Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -79,9 +79,12 @@ class onsetdetection: · 78 unmodified lines | ||
| 79 | 79 | class peakpick: |
| 80 | 80 | """ class for aubio_peakpicker """ |
| 81 | 81 | def __init__(self,threshold=0.1): |
| 82 | − self.pp = new_aubio_peakpicker(threshold) | |
| 82 | + self.pp = new_aubio_peakpicker(1) | |
| 83 | + self.out = new_fvec(1, 1) | |
| 84 | + aubio_peakpicker_set_threshold (self.pp, threshold) | |
| 83 | 85 | def do(self,fv): |
| 84 | − return aubio_peakpicker_do(self.pp, fv()) | |
| 86 | + aubio_peakpicker_do(self.pp, fv(), self.out) | |
| 87 | + return fvec_read_sample(self.out, 0, 0) | |
| 85 | 88 | def getval(self): |
| 86 | 89 | return aubio_peakpicker_get_adaptive_threshold(self.pp) |
| 87 | 90 | def __del__(self): |