src/pitch/pitch.c: allow for silence == 0, improve error message
authorPaul Brossier <piem@piem.org>
Sat, 8 Aug 2015 12:37:48 +0000 (14:37 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 8 Aug 2015 12:37:48 +0000 (14:37 +0200)
src/pitch/pitch.c

index b414b56..02636b4 100644 (file)
@@ -317,11 +317,11 @@ aubio_pitch_set_tolerance (aubio_pitch_t * p, smpl_t tol)
 uint_t
 aubio_pitch_set_silence (aubio_pitch_t * p, smpl_t silence)
 {
-  if (silence < 0 && silence > -200) {
+  if (silence <= 0 && silence >= -200) {
     p->silence = silence;
     return AUBIO_OK;
   } else {
-    AUBIO_ERR("pitch: could do set silence to %.2f", silence);
+    AUBIO_ERR("pitch: could not set silence to %.2f", silence);
     return AUBIO_FAIL;
   }
 }