Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubioonset.c

    rce6186a rc34336e  
    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);
    39   is_onset = fvec_read_sample(onset, 0);
    40   if ( is_onset && !is_silence ) {
     36  is_onset = fvec_get_sample(onset, 0);
     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.