From: Paul Brossier Date: Fri, 10 Mar 2017 19:17:36 +0000 (+0100) Subject: examples/aubioonset.c: avoid saturation in when using --mix-input X-Git-Tag: 0.4.5~20^2~31 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=d0f0d553204e182152261cfbd4d8ff625739bf6d;p=aubio.git examples/aubioonset.c: avoid saturation in when using --mix-input --- diff --git a/examples/aubioonset.c b/examples/aubioonset.c index 032eb004..680471c2 100644 --- a/examples/aubioonset.c +++ b/examples/aubioonset.c @@ -43,10 +43,12 @@ void process_block(fvec_t *ibuf, fvec_t *obuf) } else { aubio_wavetable_stop ( wavetable ); } - if (mix_input) + if (mix_input) { aubio_wavetable_do (wavetable, ibuf, obuf); - else + fvec_clamp(obuf, 1.); + } else { aubio_wavetable_do (wavetable, obuf, obuf); + } } void process_print (void)