Rubber Band Library 3.3.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-2022 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 "3.3.0"
33#define RUBBERBAND_API_MAJOR_VERSION 2
34#define RUBBERBAND_API_MINOR_VERSION 8
35
36#undef RB_EXTERN
37#ifdef _MSC_VER
38#define RB_EXTERN extern __declspec(dllexport)
39#else
40#define RB_EXTERN extern
41#endif
42
57
60
61 RubberBandOptionStretchElastic = 0x00000000, // obsolete
62 RubberBandOptionStretchPrecise = 0x00000010, // obsolete
63
67
71
74
78
82
85
88
92
95
98};
99
101
102struct RubberBandState_;
103typedef struct RubberBandState_ *RubberBandState;
104
106 unsigned int channels,
107 RubberBandOptions options,
108 double initialTimeRatio,
109 double initialPitchScale);
110
112
114
116
119
122
125
129
135
137
139
142
143RB_EXTERN void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to);
144
145RB_EXTERN void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
146RB_EXTERN void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
147
149RB_EXTERN unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
150
152
154
157
158#ifdef __cplusplus
159}
160#endif
161
162#undef RB_EXTERN
163
164#endif
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 void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options)
RB_EXTERN double rubberband_get_pitch_scale(const RubberBandState)
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)
RB_EXTERN void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples)
RB_EXTERN unsigned int rubberband_get_latency(const RubberBandState)
RB_EXTERN int rubberband_available(const RubberBandState)
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 unsigned int rubberband_get_process_size_limit(RubberBandState)
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 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 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)