- Timestamp:
- Oct 15, 2009, 6:54:23 PM (15 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 515c7b2
- Parents:
- cd77c15
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/test-pitchdetection.c
rcd77c15 rfe163ad 1 1 #include <aubio.h> 2 2 3 int main(){ 4 /* allocate some memory */ 5 uint_t win_s = 1024; /* window size */ 6 uint_t hop_s = win_s/4; /* hop size */ 7 uint_t samplerate = 44100; /* samplerate */ 8 uint_t channels = 1; /* number of channel */ 9 aubio_pitchdetection_mode mode = aubio_pitchm_freq; 10 aubio_pitchdetection_type type = aubio_pitch_yinfft; 11 fvec_t * in = new_fvec (hop_s, channels); /* input buffer */ 12 fvec_t * out = new_fvec (1, channels); /* input buffer */ 13 aubio_pitchdetection_t * o = new_aubio_pitchdetection( 14 win_s, hop_s, channels, samplerate, type, mode 15 ); 16 uint_t i = 0; 3 int 4 main () 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 */ 10 uint_t channels = 1; /* number of channel */ 11 fvec_t *in = new_fvec (hop_s, channels); /* input buffer */ 12 fvec_t *out = new_fvec (1, channels); /* input buffer */ 13 aubio_pitchdetection_t *o = 14 new_aubio_pitchdetection ("default", win_s, hop_s, channels, samplerate); 15 uint_t i = 0; 17 16 18 19 aubio_pitchdetection_do (o,in, out);20 21 17 while (i < 100) { 18 aubio_pitchdetection_do (o, in, out); 19 i++; 20 }; 22 21 23 del_aubio_pitchdetection(o);24 del_fvec(in);25 aubio_cleanup();22 del_aubio_pitchdetection (o); 23 del_fvec (in); 24 aubio_cleanup (); 26 25 27 26 return 0; 28 27 }
Note: See TracChangeset
for help on using the changeset viewer.