From d0f0d553204e182152261cfbd4d8ff625739bf6d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 10 Mar 2017 20:17:36 +0100 Subject: [PATCH] examples/aubioonset.c: avoid saturation in when using --mix-input --- examples/aubioonset.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.11.0