ref: 16ed72626ee659b4dd572797bb54ff0c504f9844
parent: e5b9a466d42d438a6c6cabdb2a3162e3dc792ccc
author: Paul Brossier <piem@piem.org>
date: Thu Nov 5 18:19:40 EST 2009
src/temporal/resampler.h: add dummy functions in case samplerate is not built in
--- a/src/temporal/resampler.c
+++ b/src/temporal/resampler.c
@@ -20,14 +20,14 @@
#include "config.h"
-#if HAVE_SAMPLERATE
-
-#include <samplerate.h> /* from libsamplerate */
-
#include "aubio_priv.h"
#include "fvec.h"
#include "temporal/resampler.h"
+#if HAVE_SAMPLERATE
+
+#include <samplerate.h> /* from libsamplerate */
+
struct _aubio_resampler_t
{
SRC_DATA *proc;
@@ -73,4 +73,25 @@
}
}
+#else
+struct _aubio_resampler_t
+{
+};
+
+aubio_resampler_t *
+new_aubio_resampler (smpl_t ratio UNUSED, uint_t type UNUSED)
+{
+ AUBIO_ERR ("aubio was not compiled with libsamplerate\n");
+ return NULL;
+}
+
+void
+del_aubio_resampler (aubio_resampler_t * s)
+{
+}
+
+void
+aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output)
+{
+}
#endif /* HAVE_SAMPLERATE */
--- a/src/temporal/resampler.h
+++ b/src/temporal/resampler.h
@@ -30,8 +30,6 @@
*/
-#if HAVE_SAMPLERATE
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -63,7 +61,5 @@
#ifdef __cplusplus
}
#endif
-
-#endif /* HAVE_SAMPLERATE */
#endif /* _RESAMPLE_H */