00001
00002
00003
00004 #ifndef _RUBBERBAND_C_API_H_
00005 #define _RUBBERBAND_C_API_H_
00006
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010
00011 #define RUBBERBAND_VERSION "1.2.0"
00012 #define RUBBERBAND_API_MAJOR_VERSION 2
00013 #define RUBBERBAND_API_MINOR_VERSION 0
00014
00028 enum RubberBandOption {
00029
00030 RubberBandOptionProcessOffline = 0x00000000,
00031 RubberBandOptionProcessRealTime = 0x00000001,
00032
00033 RubberBandOptionStretchElastic = 0x00000000,
00034 RubberBandOptionStretchPrecise = 0x00000010,
00035
00036 RubberBandOptionTransientsCrisp = 0x00000000,
00037 RubberBandOptionTransientsMixed = 0x00000100,
00038 RubberBandOptionTransientsSmooth = 0x00000200,
00039
00040 RubberBandOptionPhaseLaminar = 0x00000000,
00041 RubberBandOptionPhaseIndependent = 0x00002000,
00042
00043 RubberBandOptionThreadingAuto = 0x00000000,
00044 RubberBandOptionThreadingNever = 0x00010000,
00045 RubberBandOptionThreadingAlways = 0x00020000,
00046
00047 RubberBandOptionWindowStandard = 0x00000000,
00048 RubberBandOptionWindowShort = 0x00100000,
00049 RubberBandOptionWindowLong = 0x00200000,
00050
00051 RubberBandOptionFormantShifted = 0x00000000,
00052 RubberBandOptionFormantPreserved = 0x01000000,
00053
00054 RubberBandOptionPitchHighQuality = 0x00000000,
00055 RubberBandOptionPitchHighSpeed = 0x02000000,
00056 RubberBandOptionPitchHighConsistency = 0x04000000
00057 };
00058
00059 typedef int RubberBandOptions;
00060
00061 struct RubberBandState_;
00062 typedef struct RubberBandState_ *RubberBandState;
00063
00064 extern RubberBandState rubberband_new(unsigned int sampleRate,
00065 unsigned int channels,
00066 RubberBandOptions options,
00067 double initialTimeRatio,
00068 double initialPitchScale);
00069
00070 extern void rubberband_delete(RubberBandState);
00071
00072 extern void rubberband_reset(RubberBandState);
00073
00074 extern void rubberband_set_time_ratio(RubberBandState, double ratio);
00075 extern void rubberband_set_pitch_scale(RubberBandState, double scale);
00076
00077 extern double rubberband_get_time_ratio(const RubberBandState);
00078 extern double rubberband_get_pitch_scale(const RubberBandState);
00079
00080 extern unsigned int rubberband_get_latency(const RubberBandState);
00081
00082 extern void rubberband_set_transients_option(RubberBandState, RubberBandOptions options);
00083 extern void rubberband_set_phase_option(RubberBandState, RubberBandOptions options);
00084 extern void rubberband_set_formant_option(RubberBandState, RubberBandOptions options);
00085 extern void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options);
00086
00087 extern void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples);
00088
00089 extern unsigned int rubberband_get_samples_required(const RubberBandState);
00090
00091 extern void rubberband_set_max_process_size(RubberBandState, unsigned int samples);
00092
00093 extern void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
00094 extern void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
00095
00096 extern int rubberband_available(const RubberBandState);
00097 extern unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
00098
00099 extern unsigned int rubberband_get_channel_count(const RubberBandState);
00100
00101 extern void rubberband_calculate_stretch(RubberBandState);
00102
00103 extern void rubberband_set_debug_level(RubberBandState, int level);
00104 extern void rubberband_set_default_debug_level(int level);
00105
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109
00110 #endif