-#include <stdio.h>
+#define AUBIO_UNSTABLE 1
#include <aubio.h>
-#include "config.h"
+#include "utils_tests.h"
-char_t *path = "/home/piem/archives/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
-char_t *outpath = "/var/tmp/test.wav";
+#define aubio_sink_custom "sndfile"
-int main(){
- int err = 0;
#ifdef HAVE_SNDFILE
- uint_t samplerate = 44100;
- uint_t hop_size = 512;
- uint_t read = hop_size;
- fvec_t *vec = new_fvec(hop_size);
- aubio_source_sndfile_t * i = new_aubio_source_sndfile(path, samplerate, hop_size);
- aubio_sink_sndfile_t * o = new_aubio_sink_sndfile(outpath, samplerate);
+#define HAVE_AUBIO_SINK_CUSTOM
+#define aubio_sink_custom_t aubio_sink_sndfile_t
+#define new_aubio_sink_custom new_aubio_sink_sndfile
+#define del_aubio_sink_custom del_aubio_sink_sndfile
+#define aubio_sink_custom_do aubio_sink_sndfile_do
+#define aubio_sink_custom_do_multi aubio_sink_sndfile_do_multi
+#define aubio_sink_custom_close aubio_sink_sndfile_close
+#define aubio_sink_custom_preset_samplerate aubio_sink_sndfile_preset_samplerate
+#define aubio_sink_custom_preset_channels aubio_sink_sndfile_preset_channels
+#endif /* HAVE_SNDFILE */
- if (!i || !o) { err = -1; goto beach; }
+#include "base-sink_custom.h"
- while ( read == hop_size ) {
- aubio_source_sndfile_do(i, vec, &read);
- aubio_sink_sndfile_do(o, vec, read);
- }
+// this file uses the unstable aubio api, please use aubio_sink instead
+// see src/io/sink.h and tests/src/sink/test-sink.c
-beach:
- del_aubio_source_sndfile(i);
- del_aubio_sink_sndfile(o);
- del_fvec(vec);
-#else
- fprintf(stderr, "ERR: aubio was not compiled with aubio_source_sndfile\n");
-#endif /* HAVE_SNDFILE */
- return err;
+int main (int argc, char **argv)
+{
+ return base_main(argc, argv);
}
-