examples/aubioonset.c: synth only when need be
authorPaul Brossier <piem@piem.org>
Sat, 28 Dec 2013 23:39:05 +0000 (19:39 -0400)
committerPaul Brossier <piem@piem.org>
Sat, 28 Dec 2013 23:39:05 +0000 (19:39 -0400)
examples/aubioonset.c

index 0a3094c..814dea9 100644 (file)
@@ -31,9 +31,10 @@ smpl_t is_onset;
 
 void
 process_block(fvec_t *ibuf, fvec_t *obuf) {
-  fvec_zeros(obuf);
   aubio_onset_do (o, ibuf, onset);
   is_onset = fvec_get_sample(onset, 0);
+  if ( !usejack && ! sink_uri ) return;
+  fvec_zeros(obuf);
   if ( is_onset ) {
     aubio_wavetable_play ( wavetable );
   } else {