source: tests/src/test-pitchdetection.c @ 7a6cbbe

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

src/pitch/pitchdetection.{c,h}: clean and update prototypes, sync with latest pitch objects

  • Property mode set to 100644
File size: 995 bytes
Line 
1#include <aubio.h>
2
3int main(){
4        /* allocate some memory */
5        uint_t win_s      = 1024;                       /* window size */
6        uint_t hop_s      = win_s/4;                    /* hop size */
7        uint_t samplerate = 44100;                      /* samplerate */
8        uint_t channels   = 1;                          /* number of channel */
9        aubio_pitchdetection_mode mode = aubio_pitchm_freq;
10        aubio_pitchdetection_type type = aubio_pitch_yinfft;
11        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
12        fvec_t * out       = new_fvec (1, channels); /* input buffer */
13        aubio_pitchdetection_t * o  = new_aubio_pitchdetection(
14          win_s, hop_s, channels, samplerate, type, mode
15          );
16        uint_t i = 0;
17
18        while (i < 100) {
19          aubio_pitchdetection_do (o,in, out);
20          i++;
21        };
22
23        del_aubio_pitchdetection(o);
24        del_fvec(in);
25        aubio_cleanup();
26
27        return 0;
28}
Note: See TracBrowser for help on using the repository browser.