Changeset d22cc42


Ignore:
Timestamp:
Jul 16, 2012, 9:36:50 PM (12 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:
2ea7a10
Parents:
18c6b20
Message:

src/io/source_sndfile.c: refuse to run when when resampled hop_size does not match the requested one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_sndfile.c

    r18c6b20 rd22cc42  
    106106    s->input_data = new_fvec(s->input_hop_size);
    107107    s->resampler = new_aubio_resampler(s->ratio, 0);
    108     if (s-> ratio > 1) {
     108    if (s->ratio > 1) {
     109      // we would need to add a ring buffer for these
     110      if ( (uint_t)(s->input_hop_size * s->ratio + .5)  != s->hop_size ) {
     111        AUBIO_ERR("can not upsample from %d to %d\n", s->input_samplerate, s->samplerate);
     112        goto beach;
     113      }
    109114      AUBIO_WRN("upsampling %s from %d to % d\n", s->path, s->input_samplerate, s->samplerate);
    110115    }
     
    124129
    125130beach:
    126   AUBIO_ERR("can not read %s at samplerate %dHz with hop_size of %d\n",
     131  AUBIO_ERR("can not read %s at samplerate %dHz with a hop_size of %d\n",
    127132      s->path, s->samplerate, s->hop_size);
    128133  del_aubio_source_sndfile(s);
Note: See TracChangeset for help on using the changeset viewer.