source: tests/src/io/test-source_apple_audio_file.c @ 56a7580

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

tests/src/io/: add AUBIO_UNSTABLE

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#define AUBIO_UNSTABLE 1
2#include <aubio.h>
3#include "utils_tests.h"
4
5int main (int argc, char **argv)
6{
7  uint_t err = 0;
8  if (argc < 2) {
9    err = 2;
10    PRINT_ERR("not enough arguments\n");
11    PRINT_MSG("usage: %s <source_path> [samplerate]\n", argv[0]);
12    return err;
13  }
14
15#if __APPLE__
16  uint_t samplerate = 32000;
17  uint_t hop_size = 256;
18  uint_t n_frames = 0, read = 0;
19  if ( argc == 3 ) samplerate = atoi(argv[2]);
20
21  char_t *source_path = argv[1];
22
23  fvec_t *vec = new_fvec(hop_size);
24  aubio_source_apple_audio_t * s = new_aubio_source_apple_audio(source_path, samplerate, hop_size);
25  if (samplerate == 0 ) samplerate = aubio_source_apple_audio_get_samplerate(s);
26
27  if (!s) { err = 1; goto beach; }
28
29  do {
30    aubio_source_apple_audio_do(s, vec, &read);
31    // fvec_print (vec);
32    n_frames += read;
33  } while ( read == hop_size );
34
35beach:
36  del_aubio_source_apple_audio (s);
37  del_fvec (vec);
38#else
39  err = 3;
40  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
41#endif /* __APPLE__ */
42  return 0;
43}
Note: See TracBrowser for help on using the repository browser.