[pitch_crepe] make hdf5 optional, add an error message
authorPaul Brossier <piem@piem.org>
Thu, 17 Jan 2019 13:43:51 +0000 (14:43 +0100)
committerPaul Brossier <piem@piem.org>
Thu, 17 Jan 2019 13:43:51 +0000 (14:43 +0100)
src/pitch/pitch_crepe.c

index ee76a7d..790b114 100644 (file)
@@ -413,6 +413,7 @@ smpl_t aubio_pitch_crepe_get_tolerance (aubio_pitch_crepe_t * o)
 
 uint_t aubio_pitch_crepe_load_params(aubio_pitch_crepe_t *o)
 {
+#ifdef HAVE_HDF5
   uint_t i;
   aubio_tensor_t *k = NULL;
   fvec_t *vec = NULL;
@@ -511,4 +512,10 @@ uint_t aubio_pitch_crepe_load_params(aubio_pitch_crepe_t *o)
   }
 
   return AUBIO_OK;
+#else
+  AUBIO_ASSERT(o);
+  AUBIO_ERR("pitch_crepe: hdf5 support was not built in, failed loading"
+      " crepe model\n");
+  return AUBIO_FAIL;
+#endif
 }