source: tests/src/io/test-sink_apple_audio_file.c @ 85ebab8

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 85ebab8 was 11a1abe, checked in by Paul Brossier <piem@piem.org>, 12 years ago

tests/src/io/test-sink_apple_audio_file.c: added test

  • Property mode set to 100644
File size: 938 bytes
Line 
1#include <stdio.h>
2#include <aubio.h>
3#include "config.h"
4
5char_t *path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
6char_t *outpath = "/var/tmp/test.wav";
7
8int main(){
9  int err = 0;
10#ifdef __APPLE__
11  uint_t samplerate = 44100;
12  uint_t hop_size = 512;
13  uint_t read = hop_size;
14  fvec_t *vec = new_fvec(hop_size);
15  aubio_source_apple_audio_t * i = new_aubio_source_apple_audio(path, samplerate, hop_size);
16  aubio_sink_apple_audio_t *   o = new_aubio_sink_apple_audio(outpath, samplerate);
17
18  if (!i || !o) { err = -1; goto beach; }
19
20  while ( read == hop_size ) {
21    aubio_source_apple_audio_do(i, vec, &read);
22    aubio_sink_apple_audio_do(o, vec, read);
23  }
24
25beach:
26  del_aubio_source_apple_audio(i);
27  del_aubio_sink_apple_audio(o);
28  del_fvec(vec);
29#else
30  fprintf(stderr, "ERR: aubio was not compiled with aubio_source_apple_audio\n");
31#endif /* __APPLE__ */
32  return err;
33}
34
Note: See TracBrowser for help on using the repository browser.