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

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

tests/src: fix memory leaks

  • Property mode set to 100644
File size: 575 bytes
RevLine 
[4e9101e]1#include <aubio.h>
2
[fe163ad]3int
4main ()
5{
6  /* allocate some memory */
7  uint_t win_s = 1024;          /* window size */
8  uint_t hop_s = win_s / 4;     /* hop size */
9  uint_t samplerate = 44100;    /* samplerate */
[aea235c]10  fvec_t *in = new_fvec (hop_s);      /* input buffer */
11  fvec_t *out = new_fvec (1); /* input buffer */
[ca1abdd]12  aubio_pitch_t *o =
[aea235c]13      new_aubio_pitch ("default", win_s, hop_s, samplerate);
[fe163ad]14  uint_t i = 0;
[4e9101e]15
[fe163ad]16  while (i < 100) {
[ca1abdd]17    aubio_pitch_do (o, in, out);
[fe163ad]18    i++;
19  };
[4e9101e]20
[ca1abdd]21  del_aubio_pitch (o);
[9d6001cb]22  del_fvec (out);
[fe163ad]23  del_fvec (in);
24  aubio_cleanup ();
[4e9101e]25
[fe163ad]26  return 0;
[4e9101e]27}
Note: See TracBrowser for help on using the repository browser.