Compare commits

..

4 Commits

Author SHA1 Message Date
3a3acae777 build: make Android NDK build happy
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:56:32 +01:00
3fb8edb23e build: reduce CMake version to 3.22.1 to build with Android NDK tools 2026-03-07 22:34:54 +01:00
d0026758c1 build: add libsndfile
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:31:18 +01:00
e47115b94f build: add CMake build
Some checks failed
macOS and iOS CI / build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
2026-03-07 22:24:28 +01:00
16 changed files with 73 additions and 68 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "src/ext/libsndfile"]
path = src/ext/libsndfile
url = https://github.com/libsndfile/libsndfile.git

View File

@@ -1,65 +1,71 @@
cmake_minimum_required(VERSION 4.1) cmake_minimum_required(VERSION 3.22.1)
project(rubberband) project(rubberband)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
# -DNOMINMAX: for MSVCC to avoid defining max() as macro, breaking std::max()
# -DHAVE_UNISTD_H: for libsndfile access()
# -DUSE_PTHREADS: for Thread.h
set(CMAKE_CXX_FLAGS "-DNOMINMAX -DHAVE_UNISTD_H -DUSE_PTHREADS -DUSE_BQRESAMPLER -DHAVE_KISSFFT")
# disable libsndfile tests
set(BUILD_TESTING FALSE) set(BUILD_TESTING FALSE)
set(CMAKE_CXX_FLAGS "-DUSE_BQRESAMPLER -DHAVE_KISSFFT -DHAVE_LIBSAMPLERATE")
#include_directories(mpg123/lib/x86_64/include)
include_directories( include_directories(
./dotnet/rubberband-dll ./rubberband
./ladspa-lv2 ./src/common
./rubberband ./src/ext/float_cast
./src/common ./src/ext/kissfft
./src/ext/float_cast ./src/ext/pommier
./src/ext/getopt ./src/ext/speex
./src/ext/kissfft ./src/faster
./src/ext/pommier ./src/finer
./src/ext/speex
./src/faster
./src/finer
./vamp
) )
add_executable(rubberband if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
./src/ext/getopt/getopt.c # only for WIN32 target system
./src/ext/getopt/getopt_long.c include_directories(
./src/ext/kissfft/kiss_fft.c ./src/ext/getopt
./src/ext/kissfft/kiss_fftr.c )
./src/ext/speex/resample.c endif()
./main/main.cpp
./src/common/Allocators.cpp set(RUBBERBAND_SRC
./src/common/BQResampler.cpp #./src/ext/getopt/getopt.c
./src/common/FFT.cpp #./src/ext/getopt/getopt_long.c
./src/common/Log.cpp ./src/ext/kissfft/kiss_fft.c
./src/common/mathmisc.cpp ./src/ext/kissfft/kiss_fftr.c
./src/common/Profiler.cpp ./src/ext/speex/resample.c
./src/common/Resampler.cpp ./main/main.cpp
./src/common/StretchCalculator.cpp ./src/common/Allocators.cpp
./src/common/sysutils.cpp ./src/common/BQResampler.cpp
./src/common/Thread.cpp ./src/common/FFT.cpp
./src/common/VectorOpsComplex.cpp ./src/common/Log.cpp
./src/faster/AudioCurveCalculator.cpp ./src/common/mathmisc.cpp
./src/faster/CompoundAudioCurve.cpp ./src/common/Profiler.cpp
./src/faster/HighFrequencyAudioCurve.cpp ./src/common/Resampler.cpp
./src/faster/PercussiveAudioCurve.cpp ./src/common/StretchCalculator.cpp
./src/faster/R2Stretcher.cpp ./src/common/sysutils.cpp
./src/faster/SilentAudioCurve.cpp ./src/common/Thread.cpp
./src/faster/StretcherChannelData.cpp ./src/common/VectorOpsComplex.cpp
./src/faster/StretcherProcess.cpp ./src/faster/AudioCurveCalculator.cpp
./src/finer/R3LiveShifter.cpp ./src/faster/CompoundAudioCurve.cpp
./src/finer/R3Stretcher.cpp ./src/faster/HighFrequencyAudioCurve.cpp
./src/rubberband-c.cpp ./src/faster/PercussiveAudioCurve.cpp
./src/RubberBandLiveShifter.cpp ./src/faster/R2Stretcher.cpp
./src/RubberBandStretcher.cpp ./src/faster/SilentAudioCurve.cpp
./src/faster/StretcherChannelData.cpp
./src/faster/StretcherProcess.cpp
./src/finer/R3LiveShifter.cpp
./src/finer/R3Stretcher.cpp
./src/rubberband-c.cpp
./src/RubberBandLiveShifter.cpp
./src/RubberBandStretcher.cpp
) )
#target_link_directories(rubberband PRIVATE mpg123/lib/x86_64)
#target_link_libraries(test_lockstep mpg123-0) add_executable(rubberband-main ${RUBBERBAND_SRC})
#target_link_libraries(rubberband ${CMAKE_SOURCE_DIR}/mpg123/lib/x86_64/libmpg123.dll.a)
add_library(rubberband SHARED ${RUBBERBAND_SRC})
add_subdirectory(src/ext/libsndfile) add_subdirectory(src/ext/libsndfile)
add_subdirectory(src/ext/libsamplerate) target_link_libraries(rubberband-main sndfile)
target_link_libraries(rubberband sndfile samplerate) target_link_libraries(rubberband sndfile)
target_include_directories(rubberband PRIVATE ${CMAKE_SOURCE_DIR}/src/ext/libsamplerate/include)

View File

@@ -49,7 +49,6 @@ using RubberBand::gettimeofday;
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#define NOMINMAX
#include <windows.h> #include <windows.h>
static void usleep(unsigned long usec) { static void usleep(unsigned long usec) {
::Sleep(usec == 0 ? 0 : usec < 1000 ? 1 : usec / 1000); ::Sleep(usec == 0 ? 0 : usec < 1000 ? 1 : usec / 1000);

View File

@@ -1,5 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library

View File

@@ -20,7 +20,6 @@
under terms other than those of the GNU General Public License, under terms other than those of the GNU General Public License,
you must obtain a valid commercial licence before doing so. you must obtain a valid commercial licence before doing so.
*/ */
#define NOMINMAX
#include "BQResampler.h" #include "BQResampler.h"

View File

@@ -1,5 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library

View File

@@ -24,7 +24,6 @@
#include "sysutils.h" #include "sysutils.h"
#ifdef _WIN32 #ifdef _WIN32
#define NOMINMAX
#include <windows.h> #include <windows.h>
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>

View File

@@ -31,6 +31,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#if OS_IS_WIN32
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -114,3 +116,5 @@ getopt(nargc, nargv, ostr)
} }
return (optopt); /* dump back option letter */ return (optopt); /* dump back option letter */
} }
#endif

View File

@@ -61,6 +61,8 @@
# if !defined(GETOPT_API) # if !defined(GETOPT_API)
# define GETOPT_API __declspec(dllimport) # define GETOPT_API __declspec(dllimport)
# endif # endif
#else
# define GETOPT_API
#endif #endif
/* /*

View File

@@ -37,6 +37,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#if OS_IS_WIN32
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -549,3 +550,5 @@ getopt_long(nargc, nargv, options, long_options, idx)
return retval; return retval;
} }
#endif /* !GETOPT_LONG */ #endif /* !GETOPT_LONG */
#endif

1
src/ext/libsndfile Submodule

Submodule src/ext/libsndfile added at 68f6c16fe1

View File

@@ -1,7 +1,5 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library
An audio time-stretching and pitch-shifting library. An audio time-stretching and pitch-shifting library.

View File

@@ -20,7 +20,6 @@
under terms other than those of the GNU General Public License, under terms other than those of the GNU General Public License,
you must obtain a valid commercial licence before doing so. you must obtain a valid commercial licence before doing so.
*/ */
#define NOMINMAX
#include "StretcherChannelData.h" #include "StretcherChannelData.h"
@@ -28,9 +27,6 @@
#include "../common/Allocators.h" #include "../common/Allocators.h"
#include <algorithm> #include <algorithm>
#include <utility>
using std::max;
namespace RubberBand namespace RubberBand
{ {
@@ -118,7 +114,7 @@ void
R2Stretcher::ChannelData::setSizes(size_t windowSize, R2Stretcher::ChannelData::setSizes(size_t windowSize,
size_t fftSize) size_t fftSize)
{ {
size_t maxSize = 2*std::max(windowSize, fftSize); size_t maxSize = 2 * std::max(windowSize, fftSize);
size_t realSize = maxSize / 2 + 1; size_t realSize = maxSize / 2 + 1;
size_t oldMax = inbuf->getSize(); size_t oldMax = inbuf->getSize();
size_t oldReal = oldMax / 2 + 1; size_t oldReal = oldMax / 2 + 1;

View File

@@ -1,5 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library

View File

@@ -1,5 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library

View File

@@ -1,5 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#define NOMINMAX
/* /*
Rubber Band Library Rubber Band Library