source: tests/src/test-resample.c @ 277918b

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 277918b was 7ac818f, checked in by Paul Brossier <piem@piem.org>, 15 years ago

tests/src: include stdio.h as needed, add HAVE_LIBSAMPLERATE

  • Property mode set to 100644
File size: 760 bytes
Line 
1#include <aubio.h>
2
3int main(){
4#if HAVE_LIBSAMPLERATE
5        /* allocate some memory */
6        uint_t win_s      = 1024;                       /* window size */
7        uint_t channels   = 1;                          /* number of channel */
8        smpl_t ratio      = 0.5;
9        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
10        fvec_t * out      = new_fvec ((uint_t)(win_s*ratio), channels);     /* input buffer */
11        aubio_resampler_t * o  = new_aubio_resampler(0.5, 0);
12        uint_t i = 0;
13
14        while (i < 100) {
15          aubio_resampler_process(o,in,out);
16          i++;
17        };
18
19        del_aubio_resampler(o);
20        del_fvec(in);
21        del_fvec(out);
22
23#endif /* HAVE_LIBSAMPLERATE */
24        return 0;
25}
Note: See TracBrowser for help on using the repository browser.