source: tests/src/notes/test-notes.c @ 4506b0c

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretch
Last change on this file since 4506b0c was 4506b0c, checked in by Paul Brossier <piem@piem.org>, 18 months ago

[tests] add notes tests

  • Property mode set to 100644
File size: 921 bytes
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  uint_t buf_size = 2048;
6  uint_t hop_size = 512;
7  uint_t samplerate = 44100;
8  smpl_t silence, minioi_ms, release_drop;
9  aubio_notes_t *o = new_aubio_notes("default",
10      buf_size, hop_size, samplerate);
11  silence = aubio_notes_get_silence(o);
12  minioi_ms = aubio_notes_get_minioi_ms(o);
13  release_drop = aubio_notes_get_release_drop(o);
14  if (aubio_notes_set_silence(o, silence)) return 1;
15  if (aubio_notes_set_minioi_ms(o, minioi_ms)) return 1;
16  if (aubio_notes_set_release_drop(o, release_drop)) return 1;
17  del_aubio_notes(o);
18  // test wrong arguments
19  if (new_aubio_notes("unknown", buf_size, hop_size, samplerate)) return 1;
20  if (new_aubio_notes("default",        0, hop_size, samplerate)) return 1;
21  if (new_aubio_notes("default", buf_size,        0, samplerate)) return 1;
22  if (new_aubio_notes("default", buf_size, hop_size,          0)) return 1;
23  return 0;
24}
Note: See TracBrowser for help on using the repository browser.