Ignore:
Timestamp:
Oct 3, 2016, 11:20:57 AM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Children:
923670d
Parents:
b21c751
Message:

src/effects/timestretch_rubberband.c: improve threading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/effects/test-timestretch.c

    rb21c751 r61abfa4  
    5252  if (transpose != 0) aubio_timestretch_set_transpose(ps, transpose);
    5353
     54#if 0
    5455  do {
     56    if (aubio_timestretch_get_opened(ps) == 0)
     57      PRINT_MSG("not opened!\n");
     58    aubio_timestretch_get_opened(ps);
    5559    aubio_timestretch_set_stretch(ps, stretch);
    5660    aubio_timestretch_set_transpose(ps, transpose);
    5761    aubio_timestretch_do(ps, out, &read);
     62    if (samplerate == 0) {
     63      PRINT_MSG("setting samplerate now to %d\n", aubio_timestretch_get_samplerate(ps));
     64      samplerate = aubio_timestretch_get_samplerate(ps);
     65      aubio_sink_preset_samplerate(o, samplerate);
     66      aubio_sink_preset_channels(o, 1);
     67    }
    5868    aubio_sink_do(o, out, read);
    5969    n_frames += read;
    6070  } while ( read == hop_size );
     71#else
     72
     73  aubio_timestretch_queue(ps, source_path, samplerate);
     74
     75  do {
     76    aubio_timestretch_get_opened(ps);
     77    aubio_timestretch_set_stretch(ps, stretch);
     78    aubio_timestretch_set_transpose(ps, transpose);
     79    aubio_timestretch_do(ps, out, &read);
     80    if (n_frames == 34999 * hop_size) {
     81      PRINT_MSG("instant queuing?\n");
     82      aubio_timestretch_queue(ps, source_path, samplerate);
     83    }
     84    if (n_frames == 64999 * hop_size) {
     85      PRINT_MSG("instant queuing 2\n");
     86      aubio_timestretch_queue(ps, "/dev/null", samplerate);
     87    }
     88    if (n_frames == 54999 * hop_size) {
     89      PRINT_MSG("instant queuing?\n");
     90      aubio_timestretch_queue(ps, source_path, samplerate);
     91    }
     92    if (n_frames == 74999 * hop_size) {
     93      PRINT_MSG("instant queuing?\n");
     94      aubio_timestretch_queue(ps, source_path, samplerate);
     95    }
     96    aubio_sink_do(o, out, read);
     97  //} while ( read == hop_size );
     98    n_frames += hop_size;
     99  } while ( n_frames < 100000 * hop_size);
     100#endif
    61101
    62102  PRINT_MSG("wrote %d frames at %dHz (%d blocks) from %s written to %s\n",
Note: See TracChangeset for help on using the changeset viewer.