diff options
Diffstat (limited to 'tests/src/pitch/test-pitchyinfft.c')
-rw-r--r-- | tests/src/pitch/test-pitchyinfft.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/src/pitch/test-pitchyinfft.c b/tests/src/pitch/test-pitchyinfft.c new file mode 100644 index 0000000..ee1ece8 --- /dev/null +++ b/tests/src/pitch/test-pitchyinfft.c @@ -0,0 +1,31 @@ +#define AUBIO_UNSTABLE 1 + +// this file uses the unstable aubio api, please use aubio_pitch instead +// see src/pitch/pitch.h and tests/src/pitch/test-pitch.c + +#include <aubio.h> + +int main (void) +{ + uint_t n = 10; // compute n times + uint_t win_s = 1024; // window size + // create some vectors + fvec_t * in = new_fvec (win_s); // input buffer + fvec_t * out = new_fvec (1); // output candidates + // create pitch object + aubio_pitchyinfft_t *p = new_aubio_pitchyinfft(44100, win_s); + aubio_pitchyinfft_set_tolerance (p, 0.2); + + while ( n-- ) { + aubio_pitchyinfft_do (p, in,out); + }; + + fvec_print(out); + + del_fvec(in); + del_fvec(out); + del_aubio_pitchyinfft(p); + aubio_cleanup(); + + return 0; +} |