Changeset 0316feb


Ignore:
Timestamp:
Nov 17, 2018, 1:24:48 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
6d41dac
Parents:
992e0ff
Message:

[filterbank] check input samplerate, not n_bands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/filterbank_mel.c

    r992e0ff r0316feb  
    220220  uint_t n_bands = coeffs->height;
    221221
     222  if (samplerate <= 0) {
     223    AUBIO_ERR("filterbank: set_mel_coeffs samplerate should be > 0\n");
     224    return AUBIO_FAIL;
     225  }
    222226  if (freq_max < 0) {
    223227    AUBIO_ERR("filterbank: set_mel_coeffs freq_max should be > 0\n");
     
    233237  } else {
    234238    start = aubio_hztomel(freq_min);
    235   }
    236   if (n_bands <= 0) {
    237     AUBIO_ERR("filterbank: set_mel_coeffs n_bands should be > 0\n");
    238     return AUBIO_FAIL;
    239239  }
    240240
     
    264264  uint_t n_bands = coeffs->height;
    265265
     266  if (samplerate <= 0) {
     267    AUBIO_ERR("filterbank: set_mel_coeffs samplerate should be > 0\n");
     268    return AUBIO_FAIL;
     269  }
    266270  if (freq_max < 0) {
    267271    AUBIO_ERR("filterbank: set_mel_coeffs freq_max should be > 0\n");
     
    277281  } else {
    278282    start = aubio_hztomel_htk(freq_min);
    279   }
    280   if (n_bands <= 0) {
    281     AUBIO_ERR("filterbank: set_mel_coeffs n_bands should be > 0\n");
    282     return AUBIO_FAIL;
    283283  }
    284284
Note: See TracChangeset for help on using the changeset viewer.