source: tests/src/pitch/test-pitch.c @ 986131d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 986131d was 986131d, checked in by Eduard Müller <mueller.eduard@googlemail.com>, 7 years ago

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 821 bytes
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  aubio_init();
6 
7  // 1. allocate some memory
8  uint_t n = 0; // frame counter
9  uint_t win_s = 1024; // window size
10  uint_t hop_s = win_s / 4; // hop size
11  uint_t samplerate = 44100; // samplerate
12  // create some vectors
13  fvec_t *input = new_fvec (hop_s); // input buffer
14  fvec_t *out = new_fvec (1); // output candidates
15  // create pitch object
16  aubio_pitch_t *o = new_aubio_pitch ("default", win_s, hop_s, samplerate);
17
18  // 2. do something with it
19  while (n < 100) {
20    // get `hop_s` new samples into `input`
21    // ...
22    // exectute pitch
23    aubio_pitch_do (o, input, out);
24    // do something with output candidates
25    // ...
26    n++;
27  };
28
29  // 3. clean up memory
30  del_aubio_pitch (o);
31  del_fvec (out);
32  del_fvec (input);
33  aubio_cleanup ();
34
35  return 0;
36}
Note: See TracBrowser for help on using the repository browser.