From 9499a546be6cd24aeaf698a8d3e13068023f0165 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 29 Mar 2005 16:04:29 +0000 Subject: [PATCH] aubioonset.c correct onset output when t-4<0 thanks goes to Hamisch Allan for spotting this --- examples/aubioonset.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/aubioonset.c b/examples/aubioonset.c index 40be2463..4960298b 100644 --- a/examples/aubioonset.c +++ b/examples/aubioonset.c @@ -173,7 +173,11 @@ int main(int argc, char **argv) { * delay to ensure the label is _before_ the * actual onset */ if (isonset && output_filename == NULL) { - outmsg("%f\n",(frames-4)*overlap_size/(float)samplerate); + if(frames >= 4) { + outmsg("%f\n",(frames-4)*overlap_size/(float)samplerate); + } else if (frames < 4) { + outmsg("%f\n",0.); + } } if (output_filename != NULL) { file_write(fileout,overlap_size,obuf); -- 2.26.2