source: src/effects/rubberband_utils.c @ 78a564b

feature/cnnfeature/crepefeature/pitchshiftfeature/timestretchfix/ffmpeg5
Last change on this file since 78a564b was 78a564b, checked in by Paul Brossier <piem@piem.org>, 5 years ago

[pitchshift] do not include config.h directly

  • Property mode set to 100644
File size: 1.9 KB
Line 
1
2
3#include "aubio_priv.h"
4
5#ifdef HAVE_RUBBERBAND
6
7#include "rubberband/rubberband-c.h"
8
9// check rubberband is 1.8.1, warn if 1.3
10#if !((RUBBERBAND_API_MAJOR_VERSION >= 2) && \
11    (RUBBERBAND_API_MINOR_VERSION >= 5))
12#warning RubberBandOptionDetectorSoft not available, \
13 please upgrade rubberband to version 1.8.1 or higher
14#define RubberBandOptionDetectorSoft 0x00000000
15#endif
16
17RubberBandOptions aubio_get_rubberband_opts(const char_t *mode)
18{
19  RubberBandOptions rboptions = RubberBandOptionProcessRealTime;
20
21  if ( strcmp(mode,"crispness:0") == 0 ) {
22    rboptions |= RubberBandOptionTransientsSmooth;
23    rboptions |= RubberBandOptionWindowLong;
24    rboptions |= RubberBandOptionPhaseIndependent;
25  } else if ( strcmp(mode, "crispness:1") == 0 ) {
26    rboptions |= RubberBandOptionDetectorSoft;
27    rboptions |= RubberBandOptionTransientsSmooth;
28    rboptions |= RubberBandOptionWindowLong;
29    rboptions |= RubberBandOptionPhaseIndependent;
30  } else if ( strcmp(mode, "crispness:2") == 0 ) {
31    rboptions |= RubberBandOptionTransientsSmooth;
32    rboptions |= RubberBandOptionPhaseIndependent;
33  } else if ( strcmp(mode, "crispness:3") == 0 ) {
34    rboptions |= RubberBandOptionTransientsSmooth;
35  } else if ( strcmp(mode, "crispness:4") == 0 ) {
36    // same as "default"
37  } else if ( strcmp(mode, "crispness:5") == 0 ) {
38    rboptions |= RubberBandOptionTransientsCrisp;
39  } else if ( strcmp(mode, "crispness:6") == 0 ) {
40    rboptions |= RubberBandOptionTransientsCrisp;
41    rboptions |= RubberBandOptionWindowShort;
42    rboptions |= RubberBandOptionPhaseIndependent;
43  } else if ( strcmp(mode, "default") == 0 ) {
44    // nothing to do
45  } else {
46    // failed parsing option string
47    return -1;
48  }
49  // other options to include
50  //p->rboptions |= RubberBandOptionWindowStandard;
51  //p->rboptions |= RubberBandOptionSmoothingOff;
52  //p->rboptions |= RubberBandOptionFormantShifted;
53  //p->rboptions |= RubberBandOptionPitchHighConsistency;
54  return rboptions;
55}
56
57#endif
Note: See TracBrowser for help on using the repository browser.