feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 4621cd6 was
21f0655,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
tests/src: add AUBIO_UNSTABLE where needed
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | #define AUBIO_UNSTABLE 1 |
---|
2 | |
---|
3 | #include <stdio.h> |
---|
4 | #include <aubio.h> |
---|
5 | |
---|
6 | int main(){ |
---|
7 | /* allocate some memory */ |
---|
8 | uint_t win_s = 1024; /* window size */ |
---|
9 | uint_t channels = 1; /* number of channel */ |
---|
10 | fvec_t * in = new_fvec (win_s, channels); /* input buffer */ |
---|
11 | fvec_t * out = new_fvec (win_s/4, channels); /* input buffer */ |
---|
12 | |
---|
13 | /* allocate fft and other memory space */ |
---|
14 | aubio_beattracking_t * tempo = new_aubio_beattracking(win_s, channels); |
---|
15 | |
---|
16 | uint_t i = 0; |
---|
17 | |
---|
18 | smpl_t curtempo, curtempoconf; |
---|
19 | |
---|
20 | while (i < 10) { |
---|
21 | aubio_beattracking_do(tempo,in,out); |
---|
22 | curtempo = aubio_beattracking_get_bpm(tempo); |
---|
23 | if (curtempo != 0.) { |
---|
24 | fprintf(stdout,"%f\n",curtempo); |
---|
25 | return 1; |
---|
26 | } |
---|
27 | curtempoconf = aubio_beattracking_get_confidence(tempo); |
---|
28 | if (curtempoconf != 0.) { |
---|
29 | fprintf(stdout,"%f\n",curtempo); |
---|
30 | return 1; |
---|
31 | } |
---|
32 | i++; |
---|
33 | }; |
---|
34 | |
---|
35 | del_aubio_beattracking(tempo); |
---|
36 | del_fvec(in); |
---|
37 | del_fvec(out); |
---|
38 | aubio_cleanup(); |
---|
39 | |
---|
40 | return 0; |
---|
41 | } |
---|
42 | |
---|
Note: See
TracBrowser
for help on using the repository browser.