feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 615ac7d was
7778f39,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
tests/src/: update to use samplerate
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[7ac818f] | 1 | #include <stdio.h> |
---|
[4e9101e] | 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 */ |
---|
[7778f39] | 10 | aubio_tempo_t * o = new_aubio_tempo("complex", win_s, win_s/4, channels, 44100.); |
---|
[4e9101e] | 11 | uint_t i = 0; |
---|
| 12 | |
---|
[e34b010] | 13 | smpl_t curtempo, curtempoconf; |
---|
[cb0415d] | 14 | |
---|
[4e9101e] | 15 | while (i < 1000) { |
---|
[5bf23f7] | 16 | aubio_tempo_do(o,in,out); |
---|
[cb0415d] | 17 | curtempo = aubio_tempo_get_bpm(o); |
---|
| 18 | if (curtempo != 0.) { |
---|
| 19 | fprintf(stdout,"%f\n",curtempo); |
---|
[e34b010] | 20 | return 1; |
---|
| 21 | } |
---|
[d7a104c] | 22 | curtempoconf = aubio_tempo_get_confidence(o); |
---|
[e34b010] | 23 | if (curtempoconf != 0.) { |
---|
| 24 | fprintf(stdout,"%f\n",curtempo); |
---|
| 25 | return 1; |
---|
[cb0415d] | 26 | } |
---|
[4e9101e] | 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.