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