Changes in / [299dbfd:be6e8e6]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    r299dbfd rbe6e8e6  
    8181    }
    8282  } else {
    83     // we are at the beginning of the file, and we don't find silence
    84     if (o->total_frames <= o->delay && o->last_onset < o ->minioi && aubio_silence_detection(input, o->silence) == 0) {
    85       //AUBIO_DBG ("beginning of file is not silent, marking as onset\n");
    86       isonset = o->delay / o->hop_size;
    87       o->last_onset = o->delay;
     83    // we are at the beginning of the file
     84    if (o->total_frames <= o->delay) {
     85      // and we don't find silence
     86      if (aubio_silence_detection(input, o->silence) == 0) {
     87        uint_t new_onset = o->total_frames;
     88        if (o->total_frames == 0 || o->last_onset + o->minioi < new_onset) {
     89          isonset = o->delay / o->hop_size;
     90          o->last_onset = o->total_frames + o->delay;
     91        }
     92      }
    8893    }
    8994  }
Note: See TracChangeset for help on using the changeset viewer.