Rubber Band Library 4.0.0
rubberband-c.h
Go to the documentation of this file.
1
2/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
3
4/*
5 Rubber Band Library
6 An audio time-stretching and pitch-shifting library.
7 Copyright 2007-2024 Particular Programs Ltd.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14
15 Alternatively, if you have a valid commercial licence for the
16 Rubber Band Library obtained by agreement with the copyright
17 holders, you may redistribute and/or modify it under the terms
18 described in that licence.
19
20 If you wish to distribute code using the Rubber Band Library
21 under terms other than those of the GNU General Public License,
22 you must obtain a valid commercial licence before doing so.
23*/
24
25#ifndef RUBBERBAND_C_API_H
26#define RUBBERBAND_C_API_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define RUBBERBAND_VERSION "4.0.0"
33#define RUBBERBAND_API_MAJOR_VERSION 3
34#define RUBBERBAND_API_MINOR_VERSION 0
35
36#undef RB_EXTERN
37#ifdef _MSC_VER
38#ifndef RUBBERBAND_STATIC
39#define RB_EXTERN extern __declspec(dllexport)
40#else
41#define RB_EXTERN extern
42#endif
43#else
44#define RB_EXTERN extern
45#endif
46
105
107
108struct RubberBandState_;
109typedef struct RubberBandState_ *RubberBandState;
110
112 unsigned int channels,
113 RubberBandOptions options,
114 double initialTimeRatio,
115 double initialPitchScale);
116
118
120
122
125
128
131
135
141
143
145
148
149RB_EXTERN void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to);
150
151RB_EXTERN void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
152RB_EXTERN void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
153
155RB_EXTERN unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
156
158
160
163
164
176
178
179struct RubberBandLiveState_;
180typedef struct RubberBandLiveState_ *RubberBandLiveState;
181
183 unsigned int channels,
184 RubberBandOptions options);
185
187
189
192
195
197
199
201
202RB_EXTERN void rubberband_live_shift(RubberBandLiveState, const float *const *input, float *const *output);
203
205
208
209
210#ifdef __cplusplus
211}
212#endif
213
214#undef RB_EXTERN
215
216#endif
RB_EXTERN void rubberband_live_set_formant_scale(RubberBandLiveState, double scale)
RB_EXTERN void rubberband_live_set_pitch_scale(RubberBandLiveState, double scale)
struct RubberBandLiveState_ * RubberBandLiveState
RubberBandOption
This is a C-linkage interface to the Rubber Band time stretcher.
@ RubberBandOptionChannelsTogether
@ RubberBandOptionThreadingAuto
@ RubberBandOptionThreadingNever
@ RubberBandOptionPitchHighConsistency
@ RubberBandOptionWindowStandard
@ RubberBandOptionDetectorSoft
@ RubberBandOptionPitchHighSpeed
@ RubberBandOptionDetectorPercussive
@ RubberBandOptionPitchHighQuality
@ RubberBandOptionEngineFaster
@ RubberBandOptionProcessRealTime
@ RubberBandOptionFormantPreserved
@ RubberBandOptionStretchPrecise
@ RubberBandOptionFormantShifted
@ RubberBandOptionDetectorCompound
@ RubberBandOptionSmoothingOn
@ RubberBandOptionPhaseLaminar
@ RubberBandOptionPhaseIndependent
@ RubberBandOptionWindowLong
@ RubberBandOptionSmoothingOff
@ RubberBandOptionProcessOffline
@ RubberBandOptionStretchElastic
@ RubberBandOptionThreadingAlways
@ RubberBandOptionTransientsCrisp
@ RubberBandOptionTransientsMixed
@ RubberBandOptionWindowShort
@ RubberBandOptionEngineFiner
@ RubberBandOptionChannelsApart
@ RubberBandOptionTransientsSmooth
struct RubberBandState_ * RubberBandState
RB_EXTERN unsigned int rubberband_get_preferred_start_pad(const RubberBandState)
RB_EXTERN void rubberband_reset(RubberBandState)
RB_EXTERN unsigned int rubberband_live_get_block_size(RubberBandLiveState)
RB_EXTERN unsigned int rubberband_live_get_start_delay(const RubberBandLiveState)
RB_EXTERN void rubberband_live_delete(RubberBandLiveState)
RB_EXTERN void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options)
RB_EXTERN double rubberband_get_pitch_scale(const RubberBandState)
RB_EXTERN void rubberband_live_set_debug_level(RubberBandLiveState, int level)
RB_EXTERN void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final)
RB_EXTERN void rubberband_set_transients_option(RubberBandState, RubberBandOptions options)
int RubberBandLiveOptions
RB_EXTERN void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples)
RB_EXTERN void rubberband_live_shift(RubberBandLiveState, const float *const *input, float *const *output)
RB_EXTERN unsigned int rubberband_get_latency(const RubberBandState)
RB_EXTERN void rubberband_live_set_formant_option(RubberBandLiveState, RubberBandOptions options)
RB_EXTERN int rubberband_available(const RubberBandState)
RB_EXTERN void rubberband_live_reset(RubberBandLiveState)
RB_EXTERN RubberBandLiveState rubberband_live_new(unsigned int sampleRate, unsigned int channels, RubberBandOptions options)
RB_EXTERN double rubberband_get_formant_scale(const RubberBandState)
RB_EXTERN void rubberband_set_default_debug_level(int level)
#define RB_EXTERN
RB_EXTERN double rubberband_get_time_ratio(const RubberBandState)
RB_EXTERN void rubberband_live_set_default_debug_level(int level)
RB_EXTERN unsigned int rubberband_get_process_size_limit(RubberBandState)
RubberBandLiveOption
@ RubberBandLiveOptionChannelsTogether
@ RubberBandLiveOptionWindowShort
@ RubberBandLiveOptionChannelsApart
@ RubberBandLiveOptionWindowMedium
@ RubberBandLiveOptionFormantPreserved
@ RubberBandLiveOptionFormantShifted
RB_EXTERN void rubberband_set_phase_option(RubberBandState, RubberBandOptions options)
RB_EXTERN void rubberband_set_formant_option(RubberBandState, RubberBandOptions options)
RB_EXTERN void rubberband_set_formant_scale(RubberBandState, double scale)
RB_EXTERN void rubberband_set_debug_level(RubberBandState, int level)
RB_EXTERN RubberBandState rubberband_new(unsigned int sampleRate, unsigned int channels, RubberBandOptions options, double initialTimeRatio, double initialPitchScale)
RB_EXTERN void rubberband_delete(RubberBandState)
RB_EXTERN void rubberband_calculate_stretch(RubberBandState)
int RubberBandOptions
RB_EXTERN void rubberband_set_max_process_size(RubberBandState, unsigned int samples)
RB_EXTERN void rubberband_set_time_ratio(RubberBandState, double ratio)
RB_EXTERN double rubberband_live_get_formant_scale(const RubberBandLiveState)
RB_EXTERN void rubberband_set_detector_option(RubberBandState, RubberBandOptions options)
RB_EXTERN void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to)
RB_EXTERN unsigned int rubberband_get_start_delay(const RubberBandState)
RB_EXTERN void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final)
RB_EXTERN unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples)
RB_EXTERN double rubberband_live_get_pitch_scale(const RubberBandLiveState)
RB_EXTERN int rubberband_get_engine_version(RubberBandState)
RB_EXTERN unsigned int rubberband_get_channel_count(const RubberBandState)
RB_EXTERN unsigned int rubberband_get_samples_required(const RubberBandState)
RB_EXTERN void rubberband_set_pitch_scale(RubberBandState, double scale)
RB_EXTERN unsigned int rubberband_live_get_channel_count(const RubberBandLiveState)