source: tests/src/test-tempo.c @ f825dd0

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

tests/src: include stdio.h as needed, add HAVE_LIBSAMPLERATE

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[7ac818f]1#include <stdio.h>
[4e9101e]2#include <aubio.h>
3
4int main(){
5        /* allocate some memory */
6        uint_t win_s      = 1024;                       /* window size */
7        uint_t channels   = 1;                          /* number of channel */
8        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
9        fvec_t * out      = new_fvec (2, channels);     /* input buffer */
10        aubio_tempo_t * o  = new_aubio_tempo(aubio_onset_complex, win_s, win_s/4, channels);
11        uint_t i = 0;
12
[e34b010]13        smpl_t curtempo, curtempoconf;
[cb0415d]14
[4e9101e]15        while (i < 1000) {
16          aubio_tempo(o,in,out);
[cb0415d]17          curtempo = aubio_tempo_get_bpm(o);
18          if (curtempo != 0.) {
19            fprintf(stdout,"%f\n",curtempo);
[e34b010]20            return 1;
21          }
[d7a104c]22          curtempoconf = aubio_tempo_get_confidence(o);
[e34b010]23          if (curtempoconf != 0.) {
24            fprintf(stdout,"%f\n",curtempo);
25            return 1;
[cb0415d]26          }
[4e9101e]27          i++;
28        };
29
30        del_aubio_tempo(o);
31        del_fvec(in);
32        del_fvec(out);
33        aubio_cleanup();
34
35        return 0;
36}
Note: See TracBrowser for help on using the repository browser.