source: tests/src/tempo/test-beattracking.c @ 11a1abe

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

tests/: move tests around

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