From: Paul Brossier Date: Sun, 24 Aug 2014 14:32:58 +0000 (-0500) Subject: src/onset/onset.c: avoid doubled onset at start X-Git-Tag: 0.4.2~66 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=28c066ed57b74c99d760619b600e800632394643;p=aubio.git src/onset/onset.c: avoid doubled onset at start --- diff --git a/src/onset/onset.c b/src/onset/onset.c index 115f4c67..04002ff8 100644 --- a/src/onset/onset.c +++ b/src/onset/onset.c @@ -68,7 +68,7 @@ void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset) } } else { // we are at the beginning of the file, and we don't find silence - if (o->total_frames == 0 && aubio_silence_detection(input, o->silence) == 0) { + if (o->total_frames <= o->delay && o->last_onset < o ->minioi && aubio_silence_detection(input, o->silence) == 0) { //AUBIO_DBG ("beginning of file is not silent, marking as onset\n"); isonset = o->delay / o->hop_size; o->last_onset = o->delay;