ref: 28c066ed57b74c99d760619b600e800632394643
parent: 5a2a6c66beda0cf64fb687834118e78ed268c1b6
author: Paul Brossier <piem@piem.org>
date: Sun Aug 24 05:32:58 EDT 2014
src/onset/onset.c: avoid doubled onset at start
--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -68,7 +68,7 @@
}
} 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;