examples/aubiotrack.c: avoid saturation in when using --mix-input
authorPaul Brossier <piem@piem.org>
Fri, 10 Mar 2017 19:34:38 +0000 (20:34 +0100)
committerPaul Brossier <piem@piem.org>
Fri, 10 Mar 2017 19:34:38 +0000 (20:34 +0100)
examples/aubiotrack.c

index 36267cf..ba047d3 100644 (file)
@@ -46,10 +46,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) {