Changeset b257b60 for src/onset/onset.c
- Timestamp:
- Aug 12, 2015, 7:21:38 PM (9 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:
- 60fc05b
- Parents:
- 3a1a5d6 (diff), 7b2d740 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
r3a1a5d6 rb257b60 69 69 } else { 70 70 // we are at the beginning of the file, and we don't find silence 71 if (o->total_frames == 0&& aubio_silence_detection(input, o->silence) == 0) {71 if (o->total_frames <= o->delay && o->last_onset < o ->minioi && aubio_silence_detection(input, o->silence) == 0) { 72 72 //AUBIO_DBG ("beginning of file is not silent, marking as onset\n"); 73 73 isonset = o->delay / o->hop_size; … … 100 100 } 101 101 102 smpl_t aubio_onset_get_silence(aubio_onset_t * o) { 103 return o->silence; 104 } 105 102 106 uint_t aubio_onset_set_threshold(aubio_onset_t * o, smpl_t threshold) { 103 107 aubio_peakpicker_set_threshold(o->pp, threshold); … … 173 177 { 174 178 aubio_onset_t * o = AUBIO_NEW(aubio_onset_t); 179 180 /* check parameters are valid */ 181 if ((sint_t)hop_size < 1) { 182 AUBIO_ERR("onset: got hop_size %d, but can not be < 1\n", hop_size); 183 goto beach; 184 } else if ((sint_t)buf_size < 1) { 185 AUBIO_ERR("onset: got buffer_size %d, but can not be < 1\n", buf_size); 186 goto beach; 187 } else if (buf_size < hop_size) { 188 AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", buf_size, hop_size); 189 goto beach; 190 } else if ((sint_t)samplerate < 1) { 191 AUBIO_ERR("onset: samplerate (%d) can not be < 1\n", samplerate); 192 goto beach; 193 } 194 175 195 /* store creation parameters */ 176 196 o->samplerate = samplerate; … … 194 214 o->total_frames = 0; 195 215 return o; 216 217 beach: 218 AUBIO_FREE(o); 219 return NULL; 196 220 } 197 221
Note: See TracChangeset
for help on using the changeset viewer.