source: tests/src/test-beattracking.c @ e03f74d

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

move python/tests to tests/python, examples/tests to tests/src, add .bzrignore

  • 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.