Changeset a874c48 for src/effects


Ignore:
Timestamp:
Dec 7, 2018, 1:28:54 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
992ac88
Parents:
456a784
git-author:
Paul Brossier <piem@piem.org> (09/29/16 16:21:50)
git-committer:
Paul Brossier <piem@piem.org> (12/07/18 01:28:54)
Message:

src/effects/timestretch_rubberband.c: split into functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/effects/timestretch_rubberband.c

    r456a784 ra874c48  
    5252extern RubberBandOptions aubio_get_rubberband_opts(const char_t *mode);
    5353
     54static void aubio_timestretch_warmup (aubio_timestretch_t * p);
     55static sint_t aubio_timestretch_fetch(aubio_timestretch_t *p);
     56
    5457aubio_timestretch_t *
    5558new_aubio_timestretch (const char_t * uri, const char_t * mode,
     
    8689  //rubberband_set_debug_level(p->rb, 10);
    8790
    88 #if 1
     91  aubio_timestretch_warmup(p);
     92
     93  return p;
     94
     95beach:
     96  del_aubio_timestretch(p);
     97  return NULL;
     98}
     99
     100static void
     101aubio_timestretch_warmup (aubio_timestretch_t * p)
     102{
    89103  // warm up rubber band
    90104  uint_t source_read = 0;
     
    98112    available = rubberband_available(p->rb);
    99113  }
    100 #endif
    101 
    102   return p;
    103 
    104 beach:
    105   del_aubio_timestretch(p);
    106   return NULL;
    107114}
    108115
     
    184191}
    185192
    186 void
    187 aubio_timestretch_do (aubio_timestretch_t * p, fvec_t * out, uint_t * read)
     193sint_t
     194aubio_timestretch_fetch(aubio_timestretch_t *p)
    188195{
    189196  uint_t source_read = p->hopsize;
     
    198205    available = rubberband_available(p->rb);
    199206  }
     207  return source_read;
     208}
     209
     210void
     211aubio_timestretch_do (aubio_timestretch_t * p, fvec_t * out, uint_t * read)
     212{
     213  int available = aubio_timestretch_fetch(p);
    200214  // now retrieve the samples and write them into out->data
    201215  if (available >= (int)p->hopsize) {
Note: See TracChangeset for help on using the changeset viewer.