source: tests/src/test-tempo.c @ 5c0662a

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

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

  • Property mode set to 100644
File size: 1.0 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 (2, channels);     /* input buffer */
9        aubio_tempo_t * o  = new_aubio_tempo(aubio_onset_complex, win_s, win_s/4, channels);
10        uint_t i = 0;
11
12        smpl_t curtempo, curtempoconf;
13
14        while (i < 1000) {
15          aubio_tempo(o,in,out);
16          curtempo = aubio_tempo_get_bpm(o);
17          if (curtempo != 0.) {
18            fprintf(stdout,"%f\n",curtempo);
19            return 1;
20          }
21          curtempoconf = aubio_beattracking_get_confidence(o);
22          if (curtempoconf != 0.) {
23            fprintf(stdout,"%f\n",curtempo);
24            return 1;
25          }
26          i++;
27        };
28
29        del_aubio_tempo(o);
30        del_fvec(in);
31        del_fvec(out);
32        aubio_cleanup();
33
34        return 0;
35}
Note: See TracBrowser for help on using the repository browser.