source: examples/tests/test-beattracking.c @ e34b010

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

beattracking.{c,h},tempo.{c,h}: add aubio_beattracking_get_confidence

  • Property mode set to 100644
File size: 1.1 KB
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, curtempoconf;
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          curtempoconf = aubio_beattracking_get_confidence(tempo);
25          if (curtempoconf != 0.) {
26            fprintf(stdout,"%f\n",curtempo);
27            return 1;
28          }
29          i++;
30        };
31
32        del_aubio_beattracking(tempo);
33        del_fvec(in);
34        del_fvec(out);
35        aubio_cleanup();
36
37        return 0;
38}
39
Note: See TracBrowser for help on using the repository browser.