comparison win32-mingw/include/rubberband/rubberband-c.h @ 98:4188fd8db918

Add Rubber Band build
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:58:55 +0000
parents
children
comparison
equal deleted inserted replaced
97:efb4b8187266 98:4188fd8db918
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Rubber Band Library
5 An audio time-stretching and pitch-shifting library.
6 Copyright 2007-2012 Particular Programs Ltd.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
13
14 Alternatively, if you have a valid commercial licence for the
15 Rubber Band Library obtained by agreement with the copyright
16 holders, you may redistribute and/or modify it under the terms
17 described in that licence.
18
19 If you wish to distribute code using the Rubber Band Library
20 under terms other than those of the GNU General Public License,
21 you must obtain a valid commercial licence before doing so.
22 */
23
24 #ifndef _RUBBERBAND_C_API_H_
25 #define _RUBBERBAND_C_API_H_
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define RUBBERBAND_VERSION "1.8.1"
32 #define RUBBERBAND_API_MAJOR_VERSION 2
33 #define RUBBERBAND_API_MINOR_VERSION 5
34
35 /**
36 * This is a C-linkage interface to the Rubber Band time stretcher.
37 *
38 * This is a wrapper interface: the primary interface is in C++ and is
39 * defined and documented in RubberBandStretcher.h. The library
40 * itself is implemented in C++, and requires C++ standard library
41 * support even when using the C-linkage API.
42 *
43 * Please see RubberBandStretcher.h for documentation.
44 *
45 * If you are writing to the C++ API, do not include this header.
46 */
47
48 enum RubberBandOption {
49
50 RubberBandOptionProcessOffline = 0x00000000,
51 RubberBandOptionProcessRealTime = 0x00000001,
52
53 RubberBandOptionStretchElastic = 0x00000000,
54 RubberBandOptionStretchPrecise = 0x00000010,
55
56 RubberBandOptionTransientsCrisp = 0x00000000,
57 RubberBandOptionTransientsMixed = 0x00000100,
58 RubberBandOptionTransientsSmooth = 0x00000200,
59
60 RubberBandOptionDetectorCompound = 0x00000000,
61 RubberBandOptionDetectorPercussive = 0x00000400,
62 RubberBandOptionDetectorSoft = 0x00000800,
63
64 RubberBandOptionPhaseLaminar = 0x00000000,
65 RubberBandOptionPhaseIndependent = 0x00002000,
66
67 RubberBandOptionThreadingAuto = 0x00000000,
68 RubberBandOptionThreadingNever = 0x00010000,
69 RubberBandOptionThreadingAlways = 0x00020000,
70
71 RubberBandOptionWindowStandard = 0x00000000,
72 RubberBandOptionWindowShort = 0x00100000,
73 RubberBandOptionWindowLong = 0x00200000,
74
75 RubberBandOptionSmoothingOff = 0x00000000,
76 RubberBandOptionSmoothingOn = 0x00800000,
77
78 RubberBandOptionFormantShifted = 0x00000000,
79 RubberBandOptionFormantPreserved = 0x01000000,
80
81 RubberBandOptionPitchHighQuality = 0x00000000,
82 RubberBandOptionPitchHighSpeed = 0x02000000,
83 RubberBandOptionPitchHighConsistency = 0x04000000,
84
85 RubberBandOptionChannelsApart = 0x00000000,
86 RubberBandOptionChannelsTogether = 0x10000000,
87 };
88
89 typedef int RubberBandOptions;
90
91 struct RubberBandState_;
92 typedef struct RubberBandState_ *RubberBandState;
93
94 extern RubberBandState rubberband_new(unsigned int sampleRate,
95 unsigned int channels,
96 RubberBandOptions options,
97 double initialTimeRatio,
98 double initialPitchScale);
99
100 extern void rubberband_delete(RubberBandState);
101
102 extern void rubberband_reset(RubberBandState);
103
104 extern void rubberband_set_time_ratio(RubberBandState, double ratio);
105 extern void rubberband_set_pitch_scale(RubberBandState, double scale);
106
107 extern double rubberband_get_time_ratio(const RubberBandState);
108 extern double rubberband_get_pitch_scale(const RubberBandState);
109
110 extern unsigned int rubberband_get_latency(const RubberBandState);
111
112 extern void rubberband_set_transients_option(RubberBandState, RubberBandOptions options);
113 extern void rubberband_set_detector_option(RubberBandState, RubberBandOptions options);
114 extern void rubberband_set_phase_option(RubberBandState, RubberBandOptions options);
115 extern void rubberband_set_formant_option(RubberBandState, RubberBandOptions options);
116 extern void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options);
117
118 extern void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples);
119
120 extern unsigned int rubberband_get_samples_required(const RubberBandState);
121
122 extern void rubberband_set_max_process_size(RubberBandState, unsigned int samples);
123 extern void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to);
124
125 extern void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
126 extern void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
127
128 extern int rubberband_available(const RubberBandState);
129 extern unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
130
131 extern unsigned int rubberband_get_channel_count(const RubberBandState);
132
133 extern void rubberband_calculate_stretch(RubberBandState);
134
135 extern void rubberband_set_debug_level(RubberBandState, int level);
136 extern void rubberband_set_default_debug_level(int level);
137
138 #ifdef __cplusplus
139 }
140 #endif
141
142 #endif