Ignore:
Timestamp:
Jun 22, 2016, 1:00:10 PM (9 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, pitchshift, sampler, timestretch, yinfft+
Children:
4b9443c4
Parents:
60fc05b (diff), 6769586 (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.
Message:

Merge branch 'master' into notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/temporal/a_weighting.c

    r60fc05b rf264b17  
    3030{
    3131  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
     32
     33  if ((sint_t)samplerate <= 0) {
     34    AUBIO_ERROR("aubio_filter: failed setting A-weighting with samplerate %d\n", samplerate);
     35    return AUBIO_FAIL;
     36  }
     37  if (f == NULL) {
     38    AUBIO_ERROR("aubio_filter: failed setting A-weighting with filter NULL\n");
     39    return AUBIO_FAIL;
     40  }
     41
     42  order = aubio_filter_get_order (f);
     43  if (order != 7) {
     44    AUBIO_ERROR ("aubio_filter: order of A-weighting filter must be 7, not %d\n", order);
     45    return 1;
     46  }
     47
    3248  aubio_filter_set_samplerate (f, samplerate);
    3349  bs = aubio_filter_get_feedforward (f);
    3450  as = aubio_filter_get_feedback (f);
    3551  b = bs->data, a = as->data;
    36   order = aubio_filter_get_order (f);
    37 
    38   if (order != 7) {
    39     AUBIO_ERROR ("order of A-weighting filter must be 7, not %d\n", order);
    40     return 1;
    41   }
    4252
    4353  /* select coefficients according to sampling frequency */
     
    245255{
    246256  aubio_filter_t *f = new_aubio_filter (7);
    247   aubio_filter_set_a_weighting (f, samplerate);
     257  if (aubio_filter_set_a_weighting(f,samplerate) != AUBIO_OK) {
     258    del_aubio_filter(f);
     259    return NULL;
     260  }
    248261  return f;
    249262}
Note: See TracChangeset for help on using the changeset viewer.