From: Paul Brossier Date: Tue, 29 Mar 2005 16:04:29 +0000 (+0000) Subject: aubioonset.c correct onset output when t-4<0 X-Git-Tag: bzr2git~935 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9499a546be6cd24aeaf698a8d3e13068023f0165;p=aubio.git aubioonset.c correct onset output when t-4<0 thanks goes to Hamisch Allan for spotting this --- 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);