Changeset ce6186a for examples/aubioonset.c
- Timestamp:
- Dec 8, 2013, 2:14:09 AM (11 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:
- 3826e0b
- Parents:
- fe6a393a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubioonset.c
rfe6a393a rce6186a 28 28 aubio_wavetable_t *wavetable; 29 29 fvec_t *onset; 30 smpl_t is_onset; 31 uint_t is_silence = 0.; 30 32 31 33 void … … 33 35 fvec_zeros(obuf); 34 36 aubio_onset_do (o, ibuf, onset); 35 if ( fvec_read_sample(onset, 0) ) { 37 if (silence_threshold != -90.) 38 is_silence = aubio_silence_detection(ibuf, silence_threshold); 39 is_onset = fvec_read_sample(onset, 0); 40 if ( is_onset && !is_silence ) { 36 41 aubio_wavetable_play ( wavetable ); 37 42 } else { … … 47 52 process_print (void) 48 53 { 49 smpl_t onset_found = fvec_read_sample (onset, 0); 50 if (onset_found) { 54 if ( is_onset && !is_silence ) { 51 55 outmsg ("%f\n", aubio_onset_get_last_s (o) ); 52 56 } … … 60 64 verbmsg ("buffer_size: %d, ", buffer_size); 61 65 verbmsg ("hop_size: %d, ", hop_size); 66 verbmsg ("threshold: %f, ", silence_threshold); 62 67 verbmsg ("threshold: %f\n", onset_threshold); 63 68
Note: See TracChangeset
for help on using the changeset viewer.