feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since cc9d0cc was
5bf23f7,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
src/tempo/tempo.{c,h}: rename aubio_tempo to aubio_tempo_do
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #include <stdio.h> |
---|
2 | #include <aubio.h> |
---|
3 | |
---|
4 | int 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 | |
---|
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.