source: examples/tests/test-beattracking.c @ 6fadb0d

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 6fadb0d was 6fadb0d, checked in by Paul Brossier <piem@piem.org>, 13 years ago

test-beattracking.c: add call to aubio_beattracking_get_bpm, making sure it returns 0 on silent frames

  • Property mode set to 100644
File size: 958 bytes
Line 
1#include <aubio.h>
2
3int main(){
4        /* allocate some memory */
5        uint_t win_s      = 1024;                       /* window size */
6        uint_t channels   = 1;                          /* number of channel */
7        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
8        fvec_t * out      = new_fvec (win_s/4, channels);     /* input buffer */
9 
10        /* allocate fft and other memory space */
11        aubio_beattracking_t * tempo  = new_aubio_beattracking(win_s, channels);
12
13        uint_t i = 0;
14
15        smpl_t curtempo;
16
17        while (i < 10) {
18          aubio_beattracking_do(tempo,in,out);
19          curtempo = aubio_beattracking_get_bpm(tempo);
20          if (curtempo != 0.) {
21            fprintf(stdout,"%f\n",curtempo);
22            return 1;
23          }
24          i++;
25        };
26
27        del_aubio_beattracking(tempo);
28        del_fvec(in);
29        del_fvec(out);
30        aubio_cleanup();
31
32        return 0;
33}
34
Note: See TracBrowser for help on using the repository browser.