Changeset 36e9cfeb


Ignore:
Timestamp:
Sep 19, 2016, 8:22:45 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch
Children:
e467cf9
Parents:
7a5f963c
Message:

src/effects/pitchshift.c: simplify _do, calling available after process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/effects/pitchshift.c

    r7a5f963c r36e9cfeb  
    174174{
    175175  int output = 0;
    176   // this may occur when RubberBandStretcher initialPitchScale is changed
    177   while (rubberband_available(p->rb) <= (int)p->hopsize) {
    178     //AUBIO_WRN("pitchshift: catching up, only %d available\n", rubberband_available(p->rb));
    179     rubberband_process(p->rb, (const float* const*)&(in->data), 0, output);
    180   }
    181176  rubberband_process(p->rb, (const float* const*)&(in->data), p->hopsize, output);
    182   rubberband_retrieve(p->rb, (float* const*)&(out->data), p->hopsize);
     177  if (rubberband_available(p->rb) >= (int)p->hopsize) {
     178    rubberband_retrieve(p->rb, (float* const*)&(out->data), p->hopsize);
     179  } else {
     180    AUBIO_WRN("pitchshift: catching up with zeros, only %d available, needed: %d, "
     181        "current pitchscale: %f\n",
     182        rubberband_available(p->rb), p->hopsize, p->pitchscale);
     183    fvec_zeros(out);
     184  }
    183185}
    184186
Note: See TracChangeset for help on using the changeset viewer.