- Timestamp:
- Nov 26, 2018, 5:22:31 PM (6 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
- Children:
- b174319
- Parents:
- e744416
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/mfcc.c
re744416 r5ad5109 56 56 aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t); 57 57 58 if ((sint_t)n_coefs <= 0) { 59 AUBIO_ERR("mfcc: n_coefs should be > 0, got %d\n", n_coefs); 60 goto failure; 61 } 62 if ((sint_t)samplerate <= 0) { 63 AUBIO_ERR("mfcc: samplerate should be > 0, got %d\n", samplerate); 64 goto failure; 65 } 66 58 67 mfcc->win_s = win_s; 59 68 mfcc->samplerate = samplerate; … … 63 72 /* filterbank allocation */ 64 73 mfcc->fb = new_aubio_filterbank (n_filters, mfcc->win_s); 74 75 if (!mfcc->fb) 76 goto failure; 77 65 78 if (n_filters == 40) 66 79 aubio_filterbank_set_mel_coeffs_slaney (mfcc->fb, samplerate); … … 75 88 mfcc->output = new_fvec (n_filters); 76 89 90 if (!mfcc->in_dct || !mfcc->dct || !mfcc->output) 91 goto failure; 92 77 93 mfcc->scale = 1.; 78 94 79 95 return mfcc; 96 97 failure: 98 del_aubio_mfcc(mfcc); 99 return NULL; 80 100 } 81 101 … … 83 103 del_aubio_mfcc (aubio_mfcc_t * mf) 84 104 { 85 86 /* delete filterbank */ 87 del_aubio_filterbank (mf->fb); 88 89 /* delete buffers */ 90 del_fvec (mf->in_dct); 91 del_aubio_dct (mf->dct); 92 del_fvec (mf->output); 93 94 /* delete mfcc object */ 105 if (mf->fb) 106 del_aubio_filterbank (mf->fb); 107 if (mf->in_dct) 108 del_fvec (mf->in_dct); 109 if (mf->dct) 110 del_aubio_dct (mf->dct); 111 if (mf->output) 112 del_fvec (mf->output); 95 113 AUBIO_FREE (mf); 96 114 }
Note: See TracChangeset
for help on using the changeset viewer.