Merge branch 'develop' into io
[aubio.git] / tests / src / io / test-source.c
1 #include <stdio.h>
2 #include <aubio.h>
3
4 char_t *path = "/Users/piem/archives/sounds/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
5 //char_t *path = "/Users/piem/Downloads/Keziah Jones - Where's Life.mp3";
6
7 int main(){
8   uint_t samplerate = 32000;
9   uint_t hop_size = 1024;
10   uint_t read = hop_size;
11   fvec_t *vec = new_fvec(hop_size);
12   aubio_source_t* s = new_aubio_source(path, samplerate, hop_size);
13
14   if (!s) return -1;
15
16   while ( read == hop_size ) {
17     aubio_source_do(s, vec, &read);
18     fprintf(stdout, "%d [%f, %f, ..., %f]\n", read, vec->data[0], vec->data[1], vec->data[read - 1]);
19   }
20
21   del_aubio_source(s);
22
23   return 0;
24 }
25