Changeset 41b985f for src/pitch/pitch.c
- Timestamp:
- Mar 12, 2017, 11:26:24 AM (7 years ago)
- Branches:
- sampler
- Children:
- bde49c4a
- Parents:
- 71f2e5f (diff), 67b6618 (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
r71f2e5f r41b985f 112 112 aubio_pitch_t *p = AUBIO_NEW (aubio_pitch_t); 113 113 aubio_pitch_type pitch_type; 114 if (pitch_mode == NULL) { 115 AUBIO_ERR ("pitch: can not use ‘NULL‘ for pitch detection method\n"); 116 goto beach; 117 } 114 118 if (strcmp (pitch_mode, "mcomb") == 0) 115 119 pitch_type = aubio_pitcht_mcomb; … … 139 143 goto beach; 140 144 } else if (bufsize < hopsize) { 141 AUBIO_ERR("pitch: hop size (%d) is larger than win size (%d)\n", bufsize, hopsize);145 AUBIO_ERR("pitch: hop size (%d) is larger than win size (%d)\n", hopsize, bufsize); 142 146 goto beach; 143 147 } else if ((sint_t)samplerate < 1) { … … 156 160 p->buf = new_fvec (bufsize); 157 161 p->p_object = new_aubio_pitchyin (bufsize); 162 if (!p->p_object) goto beach; 158 163 p->detect_cb = aubio_pitch_do_yin; 159 164 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchyin_get_confidence; … … 163 168 p->filtered = new_fvec (hopsize); 164 169 p->pv = new_aubio_pvoc (bufsize, hopsize); 170 if (!p->pv) goto beach; 165 171 p->fftgrain = new_cvec (bufsize); 166 172 p->p_object = new_aubio_pitchmcomb (bufsize, hopsize); … … 171 177 p->buf = new_fvec (bufsize); 172 178 p->p_object = new_aubio_pitchfcomb (bufsize, hopsize); 179 if (!p->p_object) goto beach; 173 180 p->detect_cb = aubio_pitch_do_fcomb; 174 181 break; … … 181 188 p->buf = new_fvec (bufsize); 182 189 p->p_object = new_aubio_pitchyinfft (samplerate, bufsize); 190 if (!p->p_object) goto beach; 183 191 p->detect_cb = aubio_pitch_do_yinfft; 184 192 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchyinfft_get_confidence; … … 188 196 p->buf = new_fvec (bufsize); 189 197 p->p_object = new_aubio_pitchspecacf (bufsize); 198 if (!p->p_object) goto beach; 190 199 p->detect_cb = aubio_pitch_do_specacf; 191 200 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchspecacf_get_tolerance; … … 198 207 199 208 beach: 209 if (p->filtered) del_fvec(p->filtered); 210 if (p->buf) del_fvec(p->buf); 200 211 AUBIO_FREE(p); 201 212 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.