source: tests/src/tempo/test-beattracking.c @ 986131d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 986131d was 986131d, checked in by Eduard Müller <mueller.eduard@googlemail.com>, 7 years ago

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 900 bytes
Line 
1#define AUBIO_UNSTABLE 1
2
3#include <aubio.h>
4#include <stdio.h>
5
6int main (void)
7{
8  aubio_init();
9 
10  uint_t i = 0;
11  uint_t win_s = 1024; // window size
12  fvec_t * in = new_fvec (win_s); // input buffer
13  fvec_t * out = new_fvec (win_s / 4); // output beat position
14
15  // create beattracking object
16  aubio_beattracking_t * tempo  = new_aubio_beattracking(win_s, 256, 44100);
17
18  smpl_t bpm, confidence;
19
20  while (i < 10) {
21    // put some fresh data in feature vector
22    // ...
23
24    aubio_beattracking_do(tempo,in,out);
25    // do something  with the beats
26    // ...
27
28    // get bpm and confidence
29    bpm = aubio_beattracking_get_bpm(tempo);
30    confidence = aubio_beattracking_get_confidence(tempo);
31    fprintf(stderr, "found bpm %f with confidence %f\n", bpm, confidence);
32    i++;
33  };
34
35  del_aubio_beattracking(tempo);
36  del_fvec(in);
37  del_fvec(out);
38 
39  aubio_cleanup();
40
41  return 0;
42}
43
Note: See TracBrowser for help on using the repository browser.