Ignore:
Timestamp:
Dec 15, 2013, 3:08:42 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
d626fac
Parents:
c7ec2c6
Message:

examples/aubioonset.c: use built-in silence

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubioonset.c

    rc7ec2c6 r614ba69  
    2929fvec_t *onset;
    3030smpl_t is_onset;
    31 uint_t is_silence = 0.;
    3231
    3332void
     
    3534  fvec_zeros(obuf);
    3635  aubio_onset_do (o, ibuf, onset);
    37   if (silence_threshold != -90.)
    38     is_silence = aubio_silence_detection(ibuf, silence_threshold);
    3936  is_onset = fvec_read_sample(onset, 0);
    40   if ( is_onset && !is_silence ) {
     37  if ( is_onset ) {
    4138    aubio_wavetable_play ( wavetable );
    4239  } else {
     
    5249process_print (void)
    5350{
    54   if ( is_onset && !is_silence ) {
     51  if ( is_onset ) {
    5552    outmsg ("%f\n", aubio_onset_get_last_s (o) );
    5653  }
     
    6461  verbmsg ("buffer_size: %d, ", buffer_size);
    6562  verbmsg ("hop_size: %d, ", hop_size);
    66   verbmsg ("threshold: %f, ", silence_threshold);
     63  verbmsg ("silence: %f, ", silence_threshold);
    6764  verbmsg ("threshold: %f\n", onset_threshold);
    6865
    6966  o = new_aubio_onset (onset_method, buffer_size, hop_size, samplerate);
    70   if (onset_threshold != 0.) aubio_onset_set_threshold (o, onset_threshold);
     67  if (onset_threshold != 0.)
     68    aubio_onset_set_threshold (o, onset_threshold);
     69  if (silence_threshold != -90.)
     70    aubio_onset_set_silence (o, silence_threshold);
     71
    7172  onset = new_fvec (1);
    7273
Note: See TracChangeset for help on using the changeset viewer.