source: tests/src/pitch/test-pitch.c @ b65230a

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

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 821 bytes
RevLine 
[4e9101e]1#include <aubio.h>
2
[158e031]3int main (void)
[fe163ad]4{
[986131d]5  aubio_init();
6 
[c71aa44]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);
[4e9101e]17
[c71aa44]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++;
[fe163ad]27  };
[4e9101e]28
[c71aa44]29  // 3. clean up memory
[ca1abdd]30  del_aubio_pitch (o);
[9d6001cb]31  del_fvec (out);
[c71aa44]32  del_fvec (input);
[fe163ad]33  aubio_cleanup ();
[4e9101e]34
[fe163ad]35  return 0;
[4e9101e]36}
Note: See TracBrowser for help on using the repository browser.