annotate win32-mingw/include/rubberband/rubberband-c.h @ 155:54abead6ecce

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