From 11a1abeed4f2c07cef3779baea79f777ead327ed Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 15 Jul 2012 12:16:02 -0600 Subject: [PATCH] tests/src/io/test-sink_apple_audio_file.c: added test --- tests/src/io/test-sink_apple_audio_file.c | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/src/io/test-sink_apple_audio_file.c diff --git a/tests/src/io/test-sink_apple_audio_file.c b/tests/src/io/test-sink_apple_audio_file.c new file mode 100644 index 00000000..60c18b9e --- /dev/null +++ b/tests/src/io/test-sink_apple_audio_file.c @@ -0,0 +1,34 @@ +#include +#include +#include "config.h" + +char_t *path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav"; +char_t *outpath = "/var/tmp/test.wav"; + +int main(){ + int err = 0; +#ifdef __APPLE__ + uint_t samplerate = 44100; + uint_t hop_size = 512; + uint_t read = hop_size; + fvec_t *vec = new_fvec(hop_size); + aubio_source_apple_audio_t * i = new_aubio_source_apple_audio(path, samplerate, hop_size); + aubio_sink_apple_audio_t * o = new_aubio_sink_apple_audio(outpath, samplerate); + + if (!i || !o) { err = -1; goto beach; } + + while ( read == hop_size ) { + aubio_source_apple_audio_do(i, vec, &read); + aubio_sink_apple_audio_do(o, vec, read); + } + +beach: + del_aubio_source_apple_audio(i); + del_aubio_sink_apple_audio(o); + del_fvec(vec); +#else + fprintf(stderr, "ERR: aubio was not compiled with aubio_source_apple_audio\n"); +#endif /* __APPLE__ */ + return err; +} + -- 2.26.2