Rubber Band Library
1.8.1
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Rubber Band Library 00005 An audio time-stretching and pitch-shifting library. 00006 Copyright 2007-2014 Particular Programs Ltd. 00007 00008 This program is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License as 00010 published by the Free Software Foundation; either version 2 of the 00011 License, or (at your option) any later version. See the file 00012 COPYING included with this distribution for more information. 00013 00014 Alternatively, if you have a valid commercial licence for the 00015 Rubber Band Library obtained by agreement with the copyright 00016 holders, you may redistribute and/or modify it under the terms 00017 described in that licence. 00018 00019 If you wish to distribute code using the Rubber Band Library 00020 under terms other than those of the GNU General Public License, 00021 you must obtain a valid commercial licence before doing so. 00022 */ 00023 00024 #ifndef _RUBBERBAND_C_API_H_ 00025 #define _RUBBERBAND_C_API_H_ 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00031 #define RUBBERBAND_VERSION "1.8.1" 00032 #define RUBBERBAND_API_MAJOR_VERSION 2 00033 #define RUBBERBAND_API_MINOR_VERSION 5 00034 00048 enum RubberBandOption { 00049 00050 RubberBandOptionProcessOffline = 0x00000000, 00051 RubberBandOptionProcessRealTime = 0x00000001, 00052 00053 RubberBandOptionStretchElastic = 0x00000000, 00054 RubberBandOptionStretchPrecise = 0x00000010, 00055 00056 RubberBandOptionTransientsCrisp = 0x00000000, 00057 RubberBandOptionTransientsMixed = 0x00000100, 00058 RubberBandOptionTransientsSmooth = 0x00000200, 00059 00060 RubberBandOptionDetectorCompound = 0x00000000, 00061 RubberBandOptionDetectorPercussive = 0x00000400, 00062 RubberBandOptionDetectorSoft = 0x00000800, 00063 00064 RubberBandOptionPhaseLaminar = 0x00000000, 00065 RubberBandOptionPhaseIndependent = 0x00002000, 00066 00067 RubberBandOptionThreadingAuto = 0x00000000, 00068 RubberBandOptionThreadingNever = 0x00010000, 00069 RubberBandOptionThreadingAlways = 0x00020000, 00070 00071 RubberBandOptionWindowStandard = 0x00000000, 00072 RubberBandOptionWindowShort = 0x00100000, 00073 RubberBandOptionWindowLong = 0x00200000, 00074 00075 RubberBandOptionSmoothingOff = 0x00000000, 00076 RubberBandOptionSmoothingOn = 0x00800000, 00077 00078 RubberBandOptionFormantShifted = 0x00000000, 00079 RubberBandOptionFormantPreserved = 0x01000000, 00080 00081 RubberBandOptionPitchHighQuality = 0x00000000, 00082 RubberBandOptionPitchHighSpeed = 0x02000000, 00083 RubberBandOptionPitchHighConsistency = 0x04000000, 00084 00085 RubberBandOptionChannelsApart = 0x00000000, 00086 RubberBandOptionChannelsTogether = 0x10000000, 00087 }; 00088 00089 typedef int RubberBandOptions; 00090 00091 struct RubberBandState_; 00092 typedef struct RubberBandState_ *RubberBandState; 00093 00094 extern RubberBandState rubberband_new(unsigned int sampleRate, 00095 unsigned int channels, 00096 RubberBandOptions options, 00097 double initialTimeRatio, 00098 double initialPitchScale); 00099 00100 extern void rubberband_delete(RubberBandState); 00101 00102 extern void rubberband_reset(RubberBandState); 00103 00104 extern void rubberband_set_time_ratio(RubberBandState, double ratio); 00105 extern void rubberband_set_pitch_scale(RubberBandState, double scale); 00106 00107 extern double rubberband_get_time_ratio(const RubberBandState); 00108 extern double rubberband_get_pitch_scale(const RubberBandState); 00109 00110 extern unsigned int rubberband_get_latency(const RubberBandState); 00111 00112 extern void rubberband_set_transients_option(RubberBandState, RubberBandOptions options); 00113 extern void rubberband_set_detector_option(RubberBandState, RubberBandOptions options); 00114 extern void rubberband_set_phase_option(RubberBandState, RubberBandOptions options); 00115 extern void rubberband_set_formant_option(RubberBandState, RubberBandOptions options); 00116 extern void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options); 00117 00118 extern void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples); 00119 00120 extern unsigned int rubberband_get_samples_required(const RubberBandState); 00121 00122 extern void rubberband_set_max_process_size(RubberBandState, unsigned int samples); 00123 extern void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to); 00124 00125 extern void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final); 00126 extern void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final); 00127 00128 extern int rubberband_available(const RubberBandState); 00129 extern unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples); 00130 00131 extern unsigned int rubberband_get_channel_count(const RubberBandState); 00132 00133 extern void rubberband_calculate_stretch(RubberBandState); 00134 00135 extern void rubberband_set_debug_level(RubberBandState, int level); 00136 extern void rubberband_set_default_debug_level(int level); 00137 00138 #ifdef __cplusplus 00139 } 00140 #endif 00141 00142 #endif