source: tests/src/test-tempo.c @ 7b485af

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

tests/src/: update to use samplerate

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#include <stdio.h>
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("complex", win_s, win_s/4, channels, 44100.);
11        uint_t i = 0;
12
13        smpl_t curtempo, curtempoconf;
14
15        while (i < 1000) {
16          aubio_tempo_do(o,in,out);
17          curtempo = aubio_tempo_get_bpm(o);
18          if (curtempo != 0.) {
19            fprintf(stdout,"%f\n",curtempo);
20            return 1;
21          }
22          curtempoconf = aubio_tempo_get_confidence(o);
23          if (curtempoconf != 0.) {
24            fprintf(stdout,"%f\n",curtempo);
25            return 1;
26          }
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.