shithub: aubio

Download patch

ref: d626fac50971f6d8cac5097a1bb8b1cfd7c146b3
parent: 614ba69e1ef3000087d575a52317dec6a0b51292
author: Paul Brossier <piem@piem.org>
date: Sat Dec 14 16:09:17 EST 2013

examples/aubiopitch.c: use built-in silence

--- a/examples/aubiopitch.c
+++ b/examples/aubiopitch.c
@@ -63,8 +63,12 @@
   verbmsg ("tolerance: %f\n", pitch_tolerance);
 
   o = new_aubio_pitch (pitch_method, buffer_size, hop_size, samplerate);
-  if (pitch_tolerance != 0.) aubio_pitch_set_tolerance (o, pitch_tolerance);
-  if (pitch_unit != NULL) aubio_pitch_set_unit (o, pitch_unit);
+  if (pitch_tolerance != 0.)
+    aubio_pitch_set_tolerance (o, pitch_tolerance);
+  if (silence_threshold != -90.)
+    aubio_pitch_set_silence (o, silence_threshold);
+  if (pitch_unit != NULL)
+    aubio_pitch_set_unit (o, pitch_unit);
   pitch = new_fvec (1);
 
   wavetable = new_aubio_wavetable (samplerate, hop_size);
--