Changeset b257b60 for src/pitch/pitch.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/pitch/pitch.c
r3a1a5d6 rb257b60 130 130 pitch_type = aubio_pitcht_default; 131 131 } 132 133 // check parameters are valid 134 if ((sint_t)hopsize < 1) { 135 AUBIO_ERR("onset: got hopsize %d, but can not be < 1\n", hopsize); 136 goto beach; 137 } else if ((sint_t)bufsize < 1) { 138 AUBIO_ERR("onset: got buffer_size %d, but can not be < 1\n", bufsize); 139 goto beach; 140 } else if (bufsize < hopsize) { 141 AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", bufsize, hopsize); 142 goto beach; 143 } else if ((sint_t)samplerate < 1) { 144 AUBIO_ERR("onset: samplerate (%d) can not be < 1\n", samplerate); 145 goto beach; 146 } 147 132 148 p->samplerate = samplerate; 133 149 p->type = pitch_type; … … 179 195 } 180 196 return p; 197 198 beach: 199 AUBIO_FREE(p); 200 return NULL; 181 201 } 182 202 … … 238 258 pitch_mode = aubio_pitchm_freq; 239 259 else if (strcmp (pitch_unit, "hertz") == 0) 260 pitch_mode = aubio_pitchm_freq; 261 else if (strcmp (pitch_unit, "Hertz") == 0) 240 262 pitch_mode = aubio_pitchm_freq; 241 263 else if (strcmp (pitch_unit, "Hz") == 0) … … 296 318 aubio_pitch_set_silence (aubio_pitch_t * p, smpl_t silence) 297 319 { 298 if (silence < 0 && silence >-200) {320 if (silence <= 0 && silence >= -200) { 299 321 p->silence = silence; 300 322 return AUBIO_OK; 301 323 } else { 302 AUBIO_ERR("pitch: could doset silence to %.2f", silence);324 AUBIO_ERR("pitch: could not set silence to %.2f", silence); 303 325 return AUBIO_FAIL; 304 326 }
Note: See TracChangeset
for help on using the changeset viewer.