Merge
This commit is contained in:
4
.hgtags
4
.hgtags
@@ -5,3 +5,7 @@
|
||||
61fe85a73bc32955feeb6fe17e668d9f522adde4 v1.7
|
||||
61fe85a73bc32955feeb6fe17e668d9f522adde4 v1.7
|
||||
efbc861f9b9460068c48a250232d343ffa7d5726 v1.7
|
||||
551952b2e7a6bf5b1196778638c8cdc3c40b108f v1.8
|
||||
77466ee7ffb5b07efda9b1dbed858379c987a9da v1.8.1
|
||||
77466ee7ffb5b07efda9b1dbed858379c987a9da v1.8.1
|
||||
d4911a276d96f6232a68c6b8448056d3946043b9 v1.8.1
|
||||
|
||||
17
CHANGELOG
17
CHANGELOG
@@ -1,4 +1,21 @@
|
||||
|
||||
Changes in Rubber Band v1.8.1
|
||||
|
||||
* Fix a crash in formant-preserving pitch shift for some build targets
|
||||
|
||||
The API is unchanged and the library is binary compatible with
|
||||
version 1.7.
|
||||
|
||||
|
||||
Changes in Rubber Band v1.8
|
||||
|
||||
* Add build support for Win32/MSVC, Android, and various libraries
|
||||
* Add Java JNI interface
|
||||
|
||||
The API is unchanged and the library is binary compatible with
|
||||
version 1.7.
|
||||
|
||||
|
||||
Changes in Rubber Band v1.7
|
||||
|
||||
* Add the centre-focus option as an alternative processing mode for
|
||||
|
||||
2
Doxyfile
2
Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = "Rubber Band Library"
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.7
|
||||
PROJECT_NUMBER = 1.8.1
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
79
Makefile.in
79
Makefile.in
@@ -1,9 +1,15 @@
|
||||
|
||||
PREFIX := @prefix@
|
||||
CXX := @CXX@
|
||||
CXXFLAGS := -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS -DUSE_PTHREADS -DNO_TIMING -DNDEBUG @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -I. -Isrc $(OPTFLAGS)
|
||||
CC := @CC@
|
||||
CXXFLAGS := -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS -DUSE_PTHREADS -DNO_TIMING -DNDEBUG -I. -Isrc -Irubberband @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ $(OPTFLAGS)
|
||||
CFLAGS := @CFLAGS@ $(OPTFLAGS)
|
||||
LDFLAGS := @LDFLAGS@ -lpthread $(LDFLAGS)
|
||||
|
||||
JNI_CXXFLAGS := -I$(JAVA_HOME)/include
|
||||
JAVAC := $(JAVA_HOME)/bin/javac
|
||||
JAR := $(JAVA_HOME)/bin/jar
|
||||
|
||||
LIBRARY_LIBS := @SRC_LIBS@ @FFTW_LIBS@
|
||||
PROGRAM_LIBS := @SNDFILE_LIBS@ $(LIBRARY_LIBS)
|
||||
VAMP_PLUGIN_LIBS := @Vamp_LIBS@ $(LIBRARY_LIBS)
|
||||
@@ -12,33 +18,39 @@ LADSPA_PLUGIN_LIBS := $(LIBRARY_LIBS)
|
||||
MKDIR := mkdir
|
||||
AR := ar
|
||||
|
||||
INSTALL_BINDIR := $(PREFIX)/bin
|
||||
INSTALL_INCDIR := $(PREFIX)/include/rubberband
|
||||
INSTALL_LIBDIR := $(PREFIX)/lib
|
||||
INSTALL_VAMPDIR := $(PREFIX)/lib/vamp
|
||||
INSTALL_LADSPADIR := $(PREFIX)/lib/ladspa
|
||||
INSTALL_LRDFDIR := $(PREFIX)/share/ladspa/rdf
|
||||
INSTALL_PKGDIR := $(PREFIX)/lib/pkgconfig
|
||||
|
||||
LIBNAME := librubberband
|
||||
JNINAME := librubberband-jni
|
||||
JARNAME := rubberband.jar
|
||||
|
||||
DYNAMIC_EXTENSION := .so
|
||||
DYNAMIC_FULL_VERSION := .2.1.0
|
||||
DYNAMIC_ABI_VERSION := .2
|
||||
DYNAMIC_LIBNAME := librubberband$(DYNAMIC_EXTENSION)
|
||||
DYNAMIC_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-soname=$(DYNAMIC_LIBNAME)$(DYNAMIC_ABI_VERSION)
|
||||
DYNAMIC_FULL_VERSION := 2.1.0
|
||||
DYNAMIC_ABI_VERSION := 2
|
||||
DYNAMIC_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-soname=$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_ABI_VERSION)
|
||||
VAMP_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,--version-script=vamp/vamp-plugin.map
|
||||
LADSPA_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,--version-script=ladspa/ladspa-plugin.map
|
||||
|
||||
PROGRAM_TARGET := bin/rubberband
|
||||
STATIC_TARGET := lib/librubberband.a
|
||||
DYNAMIC_TARGET := lib/$(DYNAMIC_LIBNAME)
|
||||
STATIC_TARGET := lib/$(LIBNAME).a
|
||||
DYNAMIC_TARGET := lib/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
JNI_TARGET := lib/$(JNINAME)$(DYNAMIC_EXTENSION)
|
||||
JAR_TARGET := lib/$(JARNAME)
|
||||
VAMP_TARGET := lib/vamp-rubberband$(DYNAMIC_EXTENSION)
|
||||
LADSPA_TARGET := lib/ladspa-rubberband$(DYNAMIC_EXTENSION)
|
||||
|
||||
INSTALL_BINDIR := @prefix@/bin
|
||||
INSTALL_INCDIR := @prefix@/include/rubberband
|
||||
INSTALL_LIBDIR := @prefix@/lib
|
||||
INSTALL_VAMPDIR := @prefix@/lib/vamp
|
||||
INSTALL_LADSPADIR := @prefix@/lib/ladspa
|
||||
INSTALL_LRDFDIR := @prefix@/share/ladspa/rdf
|
||||
INSTALL_PKGDIR := @prefix@/lib/pkgconfig
|
||||
|
||||
all: bin lib $(PROGRAM_TARGET) $(STATIC_TARGET) $(DYNAMIC_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
|
||||
|
||||
static: $(STATIC_TARGET)
|
||||
dynamic: $(DYNAMIC_TARGET)
|
||||
library: $(STATIC_TARGET) $(DYNAMIC_TARGET)
|
||||
jni: $(JNI_TARGET) $(JAR_TARGET)
|
||||
program: $(PROGRAM_TARGET)
|
||||
vamp: $(VAMP_TARGET)
|
||||
ladspa: $(LADSPA_TARGET)
|
||||
@@ -93,6 +105,12 @@ LIBRARY_SOURCES := \
|
||||
src/StretcherChannelData.cpp \
|
||||
src/StretcherImpl.cpp
|
||||
|
||||
JNI_SOURCE := \
|
||||
src/jni/RubberBandStretcherJNI.cpp
|
||||
|
||||
JAVA_SOURCE := \
|
||||
com/breakfastquay/rubberband/RubberBandStretcher.java
|
||||
|
||||
PROGRAM_SOURCES := \
|
||||
main/main.cpp
|
||||
|
||||
@@ -112,7 +130,8 @@ LADSPA_SOURCES := \
|
||||
|
||||
LIBRARY_OBJECTS := $(LIBRARY_SOURCES:.cpp=.o)
|
||||
LIBRARY_OBJECTS := $(LIBRARY_OBJECTS:.c=.o)
|
||||
|
||||
JNI_OBJECT := $(JNI_SOURCE:.cpp=.o)
|
||||
JAVA_OBJECT := $(JAVA_SOURCE:.java=.class)
|
||||
PROGRAM_OBJECTS := $(PROGRAM_SOURCES:.cpp=.o)
|
||||
VAMP_OBJECTS := $(VAMP_SOURCES:.cpp=.o)
|
||||
LADSPA_OBJECTS := $(LADSPA_SOURCES:.cpp=.o)
|
||||
@@ -126,6 +145,16 @@ $(STATIC_TARGET): $(LIBRARY_OBJECTS)
|
||||
$(DYNAMIC_TARGET): $(LIBRARY_OBJECTS)
|
||||
$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LIBRARY_LIBS) $(LDFLAGS)
|
||||
|
||||
$(JNI_OBJECT): $(JNI_SOURCE)
|
||||
$(CXX) -c $(JNI_CXXFLAGS) $(CXXFLAGS) $^ -o $@
|
||||
|
||||
$(JNI_TARGET): $(LIBRARY_OBJECTS) $(JNI_OBJECT)
|
||||
$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LIBRARY_LIBS) $(LDFLAGS)
|
||||
|
||||
$(JAR_TARGET): $(JAVA_SOURCE)
|
||||
$(JAVAC) $^
|
||||
$(JAR) cvf $@ $(JAVA_OBJECT)
|
||||
|
||||
$(VAMP_TARGET): $(LIBRARY_OBJECTS) $(VAMP_OBJECTS)
|
||||
$(CXX) $(VAMP_LDFLAGS) -o $@ $^ $(VAMP_PLUGIN_LIBS) $(LDFLAGS)
|
||||
|
||||
@@ -148,24 +177,26 @@ install: all
|
||||
cp $(PROGRAM_TARGET) $(DESTDIR)$(INSTALL_BINDIR)
|
||||
cp $(PUBLIC_INCLUDES) $(DESTDIR)$(INSTALL_INCDIR)
|
||||
cp $(STATIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)$(DYNAMIC_ABI_VERSION)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)
|
||||
cp $(DYNAMIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)$(DYNAMIC_FULL_VERSION)
|
||||
test -n "$(DYNAMIC_FULL_VERSION)" && ln -s $(DYNAMIC_LIBNAME)$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)$(DYNAMIC_ABI_VERSION)
|
||||
test -n "$(DYNAMIC_FULL_VERSION)" && ln -s $(DYNAMIC_LIBNAME)$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_ABI_VERSION)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(JNINAME)$(DYNAMIC_EXTENSION)
|
||||
cp $(DYNAMIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_FULL_VERSION)
|
||||
ln -s $(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_ABI_VERSION)
|
||||
ln -s $(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
cp $(JNI_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(JNINAME)$(DYNAMIC_EXTENSION)
|
||||
cp $(VAMP_TARGET) $(DESTDIR)$(INSTALL_VAMPDIR)
|
||||
cp vamp/vamp-rubberband.cat $(DESTDIR)$(INSTALL_VAMPDIR)
|
||||
cp $(LADSPA_TARGET) $(DESTDIR)$(INSTALL_LADSPADIR)
|
||||
cp ladspa/ladspa-rubberband.cat $(DESTDIR)$(INSTALL_LADSPADIR)
|
||||
cp ladspa/ladspa-rubberband.rdf $(DESTDIR)$(INSTALL_LRDFDIR)
|
||||
sed "s,%PREFIX%,@prefix@," rubberband.pc.in \
|
||||
sed "s,%PREFIX%,$(PREFIX)," rubberband.pc.in \
|
||||
> $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
|
||||
|
||||
clean:
|
||||
rm -f $(LIBRARY_OBJECTS) $(PROGRAM_OBJECTS) $(LADSPA_OBJECTS) $(VAMP_OBJECTS)
|
||||
rm -f $(LIBRARY_OBJECTS) $(JNI_OBJECT) $(JAVA_OBJECT) $(PROGRAM_OBJECTS) $(LADSPA_OBJECTS) $(VAMP_OBJECTS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(PROGRAM_TARGET) $(STATIC_TARGET) $(DYNAMIC_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
|
||||
rm -f $(PROGRAM_TARGET) $(STATIC_TARGET) $(DYNAMIC_TARGET) $(JNI_TARGET) $(JAR_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
|
||||
|
||||
depend:
|
||||
makedepend -Y $(LIBRARY_SOURCES) $(PROGRAM_SOURCES)
|
||||
|
||||
58
Makefile.osx
58
Makefile.osx
@@ -1,35 +1,47 @@
|
||||
|
||||
PREFIX := /usr/local
|
||||
CXX := g++
|
||||
CC := gcc
|
||||
ARCHFLAGS :=
|
||||
OPTFLAGS := -DNDEBUG -ffast-math -mfpmath=sse -msse -msse2 -O3 -ftree-vectorize
|
||||
|
||||
CXXFLAGS := $(ARCHFLAGS) $(OPTFLAGS) -I/usr/local/include -DUSE_PTHREADS -DMALLOC_IS_ALIGNED -DHAVE_VDSP -DUSE_SPEEX -DNO_THREAD_CHECKS -DNO_TIMING -Irubberband -I. -Isrc
|
||||
|
||||
LIBRARY_LIBS := -framework Accelerate
|
||||
CXXFLAGS := $(ARCHFLAGS) $(OPTFLAGS) -I. -Isrc -Irubberband -I/usr/local/include -DUSE_PTHREADS -DMALLOC_IS_ALIGNED -DHAVE_VDSP -DUSE_SPEEX -DNO_THREAD_CHECKS -DNO_TIMING
|
||||
|
||||
CFLAGS := $(ARCHFLAGS) $(OPTFLAGS)
|
||||
LDFLAGS := $(ARCHFLAGS) -lpthread $(LDFLAGS)
|
||||
|
||||
PROGRAM_LIBS := -L/usr/local/lib -lsndfile $(LIBRARY_LIBS)
|
||||
VAMP_PLUGIN_LIBS := -L/usr/local/lib -lvamp-sdk $(LIBRARY_LIBS)
|
||||
LIBRARY_LIBS := -framework Accelerate
|
||||
PROGRAM_LIBS := -L$(PREFIX)/lib -lsndfile $(LIBRARY_LIBS)
|
||||
VAMP_PLUGIN_LIBS := -L$(PREFIX)/lib -lvamp-sdk $(LIBRARY_LIBS)
|
||||
LADSPA_PLUGIN_LIBS := $(LIBRARY_LIBS)
|
||||
|
||||
MKDIR := mkdir
|
||||
AR := ar
|
||||
|
||||
DYNAMIC_LDFLAGS := -dynamiclib
|
||||
INSTALL_BINDIR := $(PREFIX)/bin
|
||||
INSTALL_INCDIR := $(PREFIX)/include/rubberband
|
||||
INSTALL_LIBDIR := $(PREFIX)/lib
|
||||
INSTALL_VAMPDIR := $(PREFIX)/lib/vamp
|
||||
INSTALL_LADSPADIR := $(PREFIX)/lib/ladspa
|
||||
INSTALL_LRDFDIR := $(PREFIX)/share/ladspa/rdf
|
||||
INSTALL_PKGDIR := $(PREFIX)/lib/pkgconfig
|
||||
|
||||
LIBNAME := librubberband
|
||||
|
||||
DYNAMIC_EXTENSION := .dylib
|
||||
DYNAMIC_FULL_VERSION := 2.1.0
|
||||
DYNAMIC_ABI_VERSION := 2
|
||||
DYNAMIC_LDFLAGS := -dynamiclib -install_name $(INSTALL_LIBDIR)/$(LIBNAME).$(DYNAMIC_ABI_VERSION)$(DYNAMIC_EXTENSION) -current_version $(DYNAMIC_FULL_VERSION) -compatibility_version $(DYNAMIC_ABI_VERSION)
|
||||
|
||||
PROGRAM_TARGET := bin/rubberband
|
||||
STATIC_TARGET := lib/librubberband.a
|
||||
DYNAMIC_TARGET := lib/librubberband$(DYNAMIC_EXTENSION)
|
||||
STATIC_TARGET := lib/$(LIBNAME).a
|
||||
DYNAMIC_TARGET := lib/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
VAMP_TARGET := lib/vamp-rubberband$(DYNAMIC_EXTENSION)
|
||||
LADSPA_TARGET := lib/ladspa-rubberband$(DYNAMIC_EXTENSION)
|
||||
|
||||
default: bin lib $(STATIC_TARGET) $(DYNAMIC_TARGET) $(PROGRAM_TARGET)
|
||||
|
||||
all: bin lib $(STATIC_TARGET) $(DYNAMIC_TARGET) $(PROGRAM_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
|
||||
all: bin lib $(STATIC_TARGET) $(DYNAMIC_TARGET) $(PROGRAM_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
|
||||
|
||||
static: $(STATIC_TARGET)
|
||||
dynamic: $(DYNAMIC_TARGET)
|
||||
@@ -121,10 +133,10 @@ VAMP_OBJECTS := $(VAMP_SOURCES:.cpp=.o)
|
||||
LADSPA_OBJECTS := $(LADSPA_SOURCES:.cpp=.o)
|
||||
|
||||
$(PROGRAM_TARGET): $(LIBRARY_OBJECTS) $(PROGRAM_OBJECTS)
|
||||
$(CXX) -o $@ $^ $(PROGRAM_LIBS) $(PROGRAM_LIBS) $(LDFLAGS)
|
||||
$(CXX) -o $@ $^ $(PROGRAM_LIBS) $(LDFLAGS)
|
||||
|
||||
$(STATIC_TARGET): $(LIBRARY_OBJECTS)
|
||||
$(AR) rc $@ $^
|
||||
$(AR) rsc $@ $^
|
||||
|
||||
$(DYNAMIC_TARGET): $(LIBRARY_OBJECTS)
|
||||
$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LIBRARY_LIBS) $(LDFLAGS)
|
||||
@@ -140,6 +152,30 @@ bin:
|
||||
lib:
|
||||
$(MKDIR) $@
|
||||
|
||||
install: default
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_BINDIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_INCDIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_LIBDIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_VAMPDIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_LADSPADIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_LRDFDIR)
|
||||
$(MKDIR) -p $(DESTDIR)$(INSTALL_PKGDIR)
|
||||
cp $(PROGRAM_TARGET) $(DESTDIR)$(INSTALL_BINDIR)
|
||||
cp $(PUBLIC_INCLUDES) $(DESTDIR)$(INSTALL_INCDIR)
|
||||
cp $(STATIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME).$(DYNAMIC_ABI_VERSION)$(DYNAMIC_EXTENSION)
|
||||
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
cp $(DYNAMIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME).$(DYNAMIC_FULL_VERSION)$(DYNAMIC_EXTENSION)
|
||||
ln -s $(LIBNAME).$(DYNAMIC_FULL_VERSION)$(DYNAMIC_EXTENSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME).$(DYNAMIC_ABI_VERSION)$(DYNAMIC_EXTENSION)
|
||||
ln -s $(LIBNAME).$(DYNAMIC_FULL_VERSION)$(DYNAMIC_EXTENSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION)
|
||||
cp $(VAMP_TARGET) $(DESTDIR)$(INSTALL_VAMPDIR)
|
||||
cp vamp/vamp-rubberband.cat $(DESTDIR)$(INSTALL_VAMPDIR)
|
||||
cp $(LADSPA_TARGET) $(DESTDIR)$(INSTALL_LADSPADIR)
|
||||
cp ladspa/ladspa-rubberband.cat $(DESTDIR)$(INSTALL_LADSPADIR)
|
||||
cp ladspa/ladspa-rubberband.rdf $(DESTDIR)$(INSTALL_LRDFDIR)
|
||||
sed "s,%PREFIX%,$(PREFIX)," rubberband.pc.in \
|
||||
> $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
|
||||
|
||||
clean:
|
||||
rm -f $(LIBRARY_OBJECTS) $(PROGRAM_OBJECTS) $(LADSPA_OBJECTS) $(VAMP_OBJECTS)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Rubber Band
|
||||
An audio time-stretching and pitch-shifting library and utility program.
|
||||
|
||||
Written by Chris Cannam, chris.cannam@breakfastquay.com.
|
||||
Copyright 2007-2012 Particular Programs Ltd.
|
||||
Copyright 2007-2014 Particular Programs Ltd.
|
||||
|
||||
Rubber Band is a library and utility program that permits changing the
|
||||
tempo and pitch of an audio recording independently of one another.
|
||||
|
||||
@@ -103,7 +103,7 @@ public class RubberBandStretcher
|
||||
public static final int PercussiveOptions = 0x00102000;
|
||||
|
||||
static {
|
||||
System.loadLibrary("rubberband");
|
||||
System.loadLibrary("rubberband-jni");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
18
configure
vendored
18
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for RubberBand 1.7.
|
||||
# Generated by GNU Autoconf 2.69 for RubberBand 1.8.1.
|
||||
#
|
||||
# Report bugs to <chris.cannam@breakfastquay.com>.
|
||||
#
|
||||
@@ -580,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='RubberBand'
|
||||
PACKAGE_TARNAME='rubberband'
|
||||
PACKAGE_VERSION='1.7'
|
||||
PACKAGE_STRING='RubberBand 1.7'
|
||||
PACKAGE_VERSION='1.8.1'
|
||||
PACKAGE_STRING='RubberBand 1.8.1'
|
||||
PACKAGE_BUGREPORT='chris.cannam@breakfastquay.com'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1253,7 +1253,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures RubberBand 1.7 to adapt to many kinds of systems.
|
||||
\`configure' configures RubberBand 1.8.1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1314,7 +1314,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of RubberBand 1.7:";;
|
||||
short | recursive ) echo "Configuration of RubberBand 1.8.1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1411,7 +1411,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
RubberBand configure 1.7
|
||||
RubberBand configure 1.8.1
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -1705,7 +1705,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by RubberBand $as_me 1.7, which was
|
||||
It was created by RubberBand $as_me 1.8.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -4801,7 +4801,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by RubberBand $as_me 1.7, which was
|
||||
This file was extended by RubberBand $as_me 1.8.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -4854,7 +4854,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
RubberBand config.status 1.7
|
||||
RubberBand config.status 1.8.1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
|
||||
AC_INIT(RubberBand, 1.7, chris.cannam@breakfastquay.com)
|
||||
AC_INIT(RubberBand, 1.8.1, chris.cannam@breakfastquay.com)
|
||||
|
||||
AC_CONFIG_SRCDIR(src/StretcherImpl.h)
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: rubberband
|
||||
Version: 1.4.0
|
||||
Version: 1.8.1
|
||||
Description:
|
||||
Libs: -L${libdir} -lrubberband
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _RUBBERBANDSTRETCHER_H_
|
||||
#define _RUBBERBANDSTRETCHER_H_
|
||||
|
||||
#define RUBBERBAND_VERSION "1.7"
|
||||
#define RUBBERBAND_VERSION "1.8.1"
|
||||
#define RUBBERBAND_API_MAJOR_VERSION 2
|
||||
#define RUBBERBAND_API_MINOR_VERSION 5
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RUBBERBAND_VERSION "1.7"
|
||||
#define RUBBERBAND_VERSION "1.8.1"
|
||||
#define RUBBERBAND_API_MAJOR_VERSION 2
|
||||
#define RUBBERBAND_API_MINOR_VERSION 5
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ RubberBandStretcher::Impl::ChannelData::construct(const std::set<size_t> &sizes,
|
||||
|
||||
accumulator = allocate_and_zero<float>(maxSize);
|
||||
windowAccumulator = allocate_and_zero<float>(maxSize);
|
||||
ms = allocate_and_zero<float>(maxSize);
|
||||
interpolator = allocate_and_zero<float>(maxSize);
|
||||
interpolatorScale = 0;
|
||||
|
||||
@@ -176,8 +177,8 @@ RubberBandStretcher::Impl::ChannelData::setSizes(size_t windowSize,
|
||||
envelope = reallocate_and_zero(envelope, oldReal, realSize);
|
||||
fltbuf = reallocate_and_zero(fltbuf, oldMax, maxSize);
|
||||
dblbuf = reallocate_and_zero(dblbuf, oldMax, maxSize);
|
||||
|
||||
interpolator = reallocate_and_zero<float>(interpolator, oldMax, maxSize);
|
||||
ms = reallocate_and_zero(ms, oldMax, maxSize);
|
||||
interpolator = reallocate_and_zero(interpolator, oldMax, maxSize);
|
||||
|
||||
// But we do want to preserve data in these
|
||||
|
||||
@@ -243,6 +244,8 @@ RubberBandStretcher::Impl::ChannelData::~ChannelData()
|
||||
deallocate(prevError);
|
||||
deallocate(unwrappedPhase);
|
||||
deallocate(envelope);
|
||||
deallocate(interpolator);
|
||||
deallocate(ms);
|
||||
deallocate(accumulator);
|
||||
deallocate(windowAccumulator);
|
||||
deallocate(fltbuf);
|
||||
|
||||
@@ -111,6 +111,7 @@ public:
|
||||
float *accumulator;
|
||||
size_t accumulatorFill;
|
||||
float *windowAccumulator;
|
||||
float *ms; // only used when mid-side processing
|
||||
float *interpolator; // only used when time-domain smoothing is on
|
||||
int interpolatorScale;
|
||||
|
||||
|
||||
@@ -537,7 +537,7 @@ RubberBandStretcher::Impl::calculateSizes()
|
||||
// ratio) for any chunk.
|
||||
|
||||
if (m_debugLevel > 0) {
|
||||
cerr << "configure: effective ratio = " << getEffectiveRatio() << endl;
|
||||
cerr << "configure: time ratio = " << m_timeRatio << ", pitch scale = " << m_pitchScale << ", effective ratio = " << getEffectiveRatio() << endl;
|
||||
cerr << "configure: analysis window size = " << m_aWindowSize << ", synthesis window size = " << m_sWindowSize << ", fft size = " << m_fftSize << ", increment = " << m_increment << " (approx output increment = " << int(lrint(m_increment * getEffectiveRatio())) << ")" << endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ RubberBandStretcher::Impl::consumeChannel(size_t c,
|
||||
|
||||
bool resampling = resampleBeforeStretching();
|
||||
|
||||
float *ms = 0;
|
||||
const float *input = 0;
|
||||
|
||||
bool useMidSide = ((m_options & OptionChannelsTogether) &&
|
||||
@@ -214,9 +213,8 @@ RubberBandStretcher::Impl::consumeChannel(size_t c,
|
||||
#endif
|
||||
|
||||
if (useMidSide) {
|
||||
ms = (float *)alloca(samples * sizeof(float));
|
||||
prepareChannelMS(c, inputs, offset, samples, ms);
|
||||
input = ms;
|
||||
prepareChannelMS(c, inputs, offset, samples, cd.ms);
|
||||
input = cd.ms;
|
||||
} else {
|
||||
input = inputs[c] + offset;
|
||||
}
|
||||
@@ -252,9 +250,8 @@ RubberBandStretcher::Impl::consumeChannel(size_t c,
|
||||
} else {
|
||||
|
||||
if (useMidSide) {
|
||||
ms = (float *)alloca(toWrite * sizeof(float));
|
||||
prepareChannelMS(c, inputs, offset, toWrite, ms);
|
||||
input = ms;
|
||||
prepareChannelMS(c, inputs, offset, toWrite, cd.ms);
|
||||
input = cd.ms;
|
||||
} else {
|
||||
input = inputs[c] + offset;
|
||||
}
|
||||
@@ -281,6 +278,8 @@ RubberBandStretcher::Impl::processChunks(size_t c, bool &any, bool &last)
|
||||
last = false;
|
||||
any = false;
|
||||
|
||||
float *tmp = 0;
|
||||
|
||||
while (!last) {
|
||||
|
||||
if (!testInbufReadSpace(c)) {
|
||||
@@ -312,8 +311,8 @@ RubberBandStretcher::Impl::processChunks(size_t c, bool &any, bool &last)
|
||||
if (m_debugLevel > 1) {
|
||||
cerr << "channel " << c << " breaking down overlong increment " << shiftIncrement << " into " << bit << "-size bits" << endl;
|
||||
}
|
||||
if (!tmp) tmp = allocate<float>(m_aWindowSize);
|
||||
analyseChunk(c);
|
||||
float *tmp = (float *)alloca(m_aWindowSize * sizeof(float));
|
||||
v_copy(tmp, cd.fltbuf, m_aWindowSize);
|
||||
for (size_t i = 0; i < shiftIncrement; i += bit) {
|
||||
v_copy(cd.fltbuf, tmp, m_aWindowSize);
|
||||
@@ -332,6 +331,8 @@ RubberBandStretcher::Impl::processChunks(size_t c, bool &any, bool &last)
|
||||
cerr << "channel " << c << ": last = " << last << ", chunkCount = " << cd.chunkCount << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp) deallocate(tmp);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -930,7 +931,8 @@ RubberBandStretcher::Impl::formantShiftChunk(size_t channel)
|
||||
|
||||
v_scale(dblbuf, factor, cutoff);
|
||||
|
||||
cd.fft->forward(dblbuf, envelope, 0);
|
||||
process_t *spare = (process_t *)alloca((hs + 1) * sizeof(process_t));
|
||||
cd.fft->forward(dblbuf, envelope, spare);
|
||||
|
||||
v_exp(envelope, hs + 1);
|
||||
v_divide(mag, envelope, hs + 1);
|
||||
|
||||
@@ -3187,99 +3187,154 @@ FFT::~FFT()
|
||||
delete d;
|
||||
}
|
||||
|
||||
#ifndef NO_EXCEPTIONS
|
||||
#define CHECK_NOT_NULL(x) \
|
||||
if (!(x)) { \
|
||||
std::cerr << "FFT: ERROR: Null argument " #x << std::endl; \
|
||||
throw NullArgument; \
|
||||
}
|
||||
#else
|
||||
#define CHECK_NOT_NULL(x) \
|
||||
if (!(x)) { \
|
||||
std::cerr << "FFT: ERROR: Null argument " #x << std::endl; \
|
||||
std::cerr << "FFT: Would be throwing NullArgument here, if exceptions were not disabled" << std::endl; \
|
||||
return; \
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
FFT::forward(const double *R__ realIn, double *R__ realOut, double *R__ imagOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
CHECK_NOT_NULL(imagOut);
|
||||
d->forward(realIn, realOut, imagOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardInterleaved(const double *R__ realIn, double *R__ complexOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(complexOut);
|
||||
d->forwardInterleaved(realIn, complexOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardPolar(const double *R__ realIn, double *R__ magOut, double *R__ phaseOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(magOut);
|
||||
CHECK_NOT_NULL(phaseOut);
|
||||
d->forwardPolar(realIn, magOut, phaseOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardMagnitude(const double *R__ realIn, double *R__ magOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(magOut);
|
||||
d->forwardMagnitude(realIn, magOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forward(const float *R__ realIn, float *R__ realOut, float *R__ imagOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
CHECK_NOT_NULL(imagOut);
|
||||
d->forward(realIn, realOut, imagOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardInterleaved(const float *R__ realIn, float *R__ complexOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(complexOut);
|
||||
d->forwardInterleaved(realIn, complexOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardPolar(const float *R__ realIn, float *R__ magOut, float *R__ phaseOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(magOut);
|
||||
CHECK_NOT_NULL(phaseOut);
|
||||
d->forwardPolar(realIn, magOut, phaseOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::forwardMagnitude(const float *R__ realIn, float *R__ magOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(magOut);
|
||||
d->forwardMagnitude(realIn, magOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverse(const double *R__ realIn, const double *R__ imagIn, double *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(imagIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inverse(realIn, imagIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverseInterleaved(const double *R__ complexIn, double *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(complexIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inverseInterleaved(complexIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inversePolar(const double *R__ magIn, const double *R__ phaseIn, double *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(magIn);
|
||||
CHECK_NOT_NULL(phaseIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inversePolar(magIn, phaseIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverseCepstral(const double *R__ magIn, double *R__ cepOut)
|
||||
{
|
||||
CHECK_NOT_NULL(magIn);
|
||||
CHECK_NOT_NULL(cepOut);
|
||||
d->inverseCepstral(magIn, cepOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverse(const float *R__ realIn, const float *R__ imagIn, float *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(realIn);
|
||||
CHECK_NOT_NULL(imagIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inverse(realIn, imagIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverseInterleaved(const float *R__ complexIn, float *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(complexIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inverseInterleaved(complexIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inversePolar(const float *R__ magIn, const float *R__ phaseIn, float *R__ realOut)
|
||||
{
|
||||
CHECK_NOT_NULL(magIn);
|
||||
CHECK_NOT_NULL(phaseIn);
|
||||
CHECK_NOT_NULL(realOut);
|
||||
d->inversePolar(magIn, phaseIn, realOut);
|
||||
}
|
||||
|
||||
void
|
||||
FFT::inverseCepstral(const float *R__ magIn, float *R__ cepOut)
|
||||
{
|
||||
CHECK_NOT_NULL(magIn);
|
||||
CHECK_NOT_NULL(cepOut);
|
||||
d->inverseCepstral(magIn, cepOut);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,15 +45,21 @@ class FFTImpl;
|
||||
* The "interleaved" functions use the format sometimes called CCS --
|
||||
* size/2+1 real+imaginary pairs. So, the array elements at indices 1
|
||||
* and size+1 will always be zero (since the signal is real).
|
||||
*
|
||||
* All pointer arguments must point to valid data. A NullArgument
|
||||
* exception is thrown if any argument is NULL.
|
||||
*
|
||||
* Neither forward nor inverse transform is scaled.
|
||||
*
|
||||
* This class is reentrant but not thread safe: use a separate
|
||||
* instance per thread, or use a mutex.
|
||||
*/
|
||||
|
||||
class FFT
|
||||
{
|
||||
public:
|
||||
enum Exception { InvalidSize, InvalidImplementation, InternalError };
|
||||
enum Exception {
|
||||
NullArgument, InvalidSize, InvalidImplementation, InternalError
|
||||
};
|
||||
|
||||
FFT(int size, int debugLevel = 0); // may throw InvalidSize
|
||||
~FFT();
|
||||
|
||||
@@ -993,6 +993,7 @@ D_Speex::resample(const float *const R__ *const R__ in,
|
||||
|
||||
//!!! check err, respond appropriately
|
||||
|
||||
|
||||
if (m_channels > 1) {
|
||||
v_deinterleave(out, m_iout, m_channels, outcount);
|
||||
}
|
||||
@@ -1023,6 +1024,8 @@ D_Speex::resampleInterleaved(const float *const R__ in,
|
||||
data_out,
|
||||
&outcount);
|
||||
|
||||
// std::cerr << "D_SPEEX: incount " << incount << " ratio " << ratio << " req " << lrintf(ceilf(incount * ratio)) << " final " << final << " output_frames_gen " << outcount << std::endl;
|
||||
|
||||
return outcount;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef ERIKD_FLOATCAST_H
|
||||
#define ERIKD_FLOATCAST_H
|
||||
|
||||
/*
|
||||
** Copyright (C) 2001 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
**
|
||||
@@ -69,5 +72,4 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -199,105 +199,111 @@ setStretcher(JNIEnv *env, jobject obj, RubberBandStretcher *stretcher)
|
||||
env->SetLongField(obj, fid, handle);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_initialise(JNIEnv *env, jobject obj, jint sampleRate, jint channels, jint options, jdouble initialTimeRatio, jdouble initialPitchScale)
|
||||
{
|
||||
setStretcher(env, obj, new RubberBandStretcher
|
||||
(sampleRate, channels, options, initialTimeRatio, initialPitchScale));
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_dispose(JNIEnv *env, jobject obj)
|
||||
{
|
||||
delete getStretcher(env, obj);
|
||||
setStretcher(env, obj, 0);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_reset(JNIEnv *env, jobject obj)
|
||||
{
|
||||
getStretcher(env, obj)->reset();
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setTimeRatio(JNIEnv *env, jobject obj, jdouble ratio)
|
||||
{
|
||||
getStretcher(env, obj)->setTimeRatio(ratio);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setPitchScale(JNIEnv *env, jobject obj, jdouble scale)
|
||||
{
|
||||
getStretcher(env, obj)->setPitchScale(scale);
|
||||
}
|
||||
|
||||
jint
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_getChannelCount(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->getChannelCount();
|
||||
}
|
||||
|
||||
jdouble
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_getTimeRatio(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->getTimeRatio();
|
||||
}
|
||||
|
||||
jdouble
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_getPitchScale(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->getPitchScale();
|
||||
}
|
||||
|
||||
jint
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_getLatency(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->getLatency();
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setTransientsOption(JNIEnv *env, jobject obj, jint options)
|
||||
{
|
||||
getStretcher(env, obj)->setTransientsOption(options);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setDetectorOption(JNIEnv *env, jobject obj, jint options)
|
||||
{
|
||||
getStretcher(env, obj)->setDetectorOption(options);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setPhaseOption(JNIEnv *env, jobject obj, jint options)
|
||||
{
|
||||
getStretcher(env, obj)->setPhaseOption(options);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setFormantOption(JNIEnv *env, jobject obj, jint options)
|
||||
{
|
||||
getStretcher(env, obj)->setFormantOption(options);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setPitchOption(JNIEnv *env, jobject obj, jint options)
|
||||
{
|
||||
getStretcher(env, obj)->setPitchOption(options);
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setExpectedInputDuration(JNIEnv *env, jobject obj, jlong duration)
|
||||
{
|
||||
getStretcher(env, obj)->setExpectedInputDuration(duration);
|
||||
}
|
||||
|
||||
jint
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_setMaxProcessSize(JNIEnv *env, jobject obj, jint size)
|
||||
{
|
||||
getStretcher(env, obj)->setMaxProcessSize(size);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_getSamplesRequired(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->getSamplesRequired();
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_study(JNIEnv *env, jobject obj, jobjectArray data, jint offset, jint n, jboolean final)
|
||||
{
|
||||
int channels = env->GetArrayLength(data);
|
||||
@@ -318,7 +324,7 @@ Java_com_breakfastquay_rubberband_RubberBandStretcher_study(JNIEnv *env, jobject
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_process(JNIEnv *env, jobject obj, jobjectArray data, jint offset, jint n, jboolean final)
|
||||
{
|
||||
int channels = env->GetArrayLength(data);
|
||||
@@ -342,13 +348,13 @@ Java_com_breakfastquay_rubberband_RubberBandStretcher_process(JNIEnv *env, jobje
|
||||
deallocate(arr);
|
||||
}
|
||||
|
||||
jint
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_available(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return getStretcher(env, obj)->available();
|
||||
}
|
||||
|
||||
jint
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_breakfastquay_rubberband_RubberBandStretcher_retrieve(JNIEnv *env, jobject obj, jobjectArray output, jint offset, jint n)
|
||||
{
|
||||
RubberBandStretcher *stretcher = getStretcher(env, obj);
|
||||
|
||||
@@ -674,7 +674,11 @@ inline void v_abs(float *const R__ dst,
|
||||
const int count)
|
||||
{
|
||||
float tmp[count];
|
||||
#if (MACOSX_DEPLOYMENT_TARGET <= 1070 && MAC_OS_X_VERSION_MIN_REQUIRED <= 1070)
|
||||
vvfabf(tmp, dst, &count);
|
||||
#else
|
||||
vvfabsf(tmp, dst, &count);
|
||||
#endif
|
||||
v_copy(dst, tmp, count);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -52,10 +52,11 @@
|
||||
#define getpid _getpid
|
||||
#endif
|
||||
|
||||
#ifdef __MSVC__
|
||||
#if defined(__MSVC__) && _MSC_VER < 1700
|
||||
#define uint8_t unsigned __int8
|
||||
#define uint16_t unsigned __int16
|
||||
#define uint32_t unsigned __int32
|
||||
#elif defined(__MSVC__)
|
||||
#define ssize_t long
|
||||
#else
|
||||
#include <stdint.h>
|
||||
|
||||
Reference in New Issue
Block a user