Changeset e467cf9


Ignore:
Timestamp:
Sep 19, 2016, 8:30:05 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:
ed9696f
Parents:
36e9cfeb
Message:

src/effects/pitchshift.c: simplify warm-up code, remove old strcmp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/effects/pitchshift.c

    r36e9cfeb re467cf9  
    4545{
    4646  aubio_pitchshift_t *p = AUBIO_NEW (aubio_pitchshift_t);
    47   int available = 0; unsigned int latency = 0;
    4847  p->samplerate = samplerate;
    49   if (strcmp (mode, "default") != 0) {
    50     AUBIO_ERR ("unknown pitch shifting method %s\n", mode);
    51     goto beach;
    52   }
    53   //p->mode = pitch_type;
    5448  p->hopsize = hopsize;
    5549  p->timeratio = 1.;
     
    9791  //rubberband_set_debug_level(p->rb, 10);
    9892
     93#if 1
     94  // warm up rubber band
     95  unsigned int latency = 0; int available = 0;
    9996  latency = MAX(rubberband_get_latency(p->rb), p->hopsize);
    100 
    101   // warm up
    10297  fvec_t *zeros = new_fvec(p->hopsize);
    10398  while (available <= (int)latency) {
    10499    rubberband_process(p->rb, (const float* const*)&(zeros->data), p->hopsize, 0);
    105100    available = rubberband_available(p->rb);
    106 #if 0
    107     int samples_required = rubberband_get_samples_required(p->rb);
    108     AUBIO_DBG("pitchshift: warmup "
    109         "samples_required: %d, available: %d, hopsize: %d, latency: %d\n",
    110         samples_required, available, p->hopsize, latency);
     101  }
     102  del_fvec(zeros);
    111103#endif
    112   }
    113   del_fvec(zeros);
    114104
    115105  return p;
Note: See TracChangeset for help on using the changeset viewer.