diff --git a/3rdparty/soundtouch/README.html b/3rdparty/soundtouch/README.html
index 3ce778e437..edff7146bd 100644
--- a/3rdparty/soundtouch/README.html
+++ b/3rdparty/soundtouch/README.html
@@ -15,8 +15,8 @@
- SoundTouch audio processing library v2.3.3
- SoundTouch library Copyright © Olli Parviainen 2001-2024
+ SoundTouch audio processing library v2.4.0
+ SoundTouch library Copyright © Olli Parviainen 2001-2025
1. Introduction
SoundTouch is an open-source audio processing library that allows
@@ -81,8 +81,8 @@
The SoundTouch library compiles in practically any platform
supporting GNU compiler (GCC) tools.
2.2.1 Compiling with autotools
- To install build prerequisites for 'autotools' tool chain:
- sudo apt-get install automake autoconf libtool build-essential
+ To install build prerequisites for 'autotools' tool chain (for Ubuntu/Debian. Use dnf/yum/etc in other distros):
+ sudo apt install -y automake autoconf libtool build-essential
To build and install the binaries, run the following commands in
/soundtouch directory:
@@ -140,8 +140,8 @@
2.2.2 Compiling with cmake
'cmake' build scripts are provided as an alternative to the autotools toolchain.
- To install cmake build prerequisites:
- sudo apt-get install libtool build-essential cmake
+ To install cmake build prerequisites (for Ubuntu/Debian. Use dnf/yum/etc in other distros):
+ sudo apt install -y libtool build-essential cmake
To build:
cmake .
@@ -205,7 +205,7 @@
separate mono channels, this isn't recommended because processing the
channels separately would result in losing the phase coherency between
the channels, which consequently would ruin the stereo effect.
- Sample rates between 8000-48000H are supported.
+ Sample rates between 8000-48000Hz are supported.
3.2. Processing latency
The processing and latency constraints of the SoundTouch library are:
soundstretch original.wav output.wav -pitch=-0.318
- 5. Change History
+ 5. Change History
5.1. SoundTouch library Change History
- 2.3.3:
+ 2.4.0:
+ - Set CMake minimum version to 3.5 to avoid deprecation warning
+ - Increase max nr. of channels from 16 to 32
+ - Don't use `pow()` when using integer precision samples
+ - Replace `-Ofast` that's being deprecated in some compilers, by `-O3 -ffast-math`
+
+ 2.3.3:
+
- Fixing compiler warnings, maintenance fixes to make/build files for various systems
@@ -881,9 +888,14 @@
+
5.2. SoundStretch application Change History
- 2.3.3:
+ 2.4.0:
+ - parse command-line argument values with double float precision.
+
+ 2.3.3:
+
- Added support for Asian / non-latin filenames in Windows. Gnu platform has supported them already earlier.
1.9:
diff --git a/3rdparty/soundtouch/soundtouch/STTypes.h b/3rdparty/soundtouch/soundtouch/STTypes.h
index 03dea9e43d..26e9af71db 100644
--- a/3rdparty/soundtouch/soundtouch/STTypes.h
+++ b/3rdparty/soundtouch/soundtouch/STTypes.h
@@ -56,8 +56,9 @@ typedef unsigned long ulong;
namespace soundtouch
{
- /// Max allowed number of channels
- #define SOUNDTOUCH_MAX_CHANNELS 16
+ /// Max allowed number of channels. This is not a hard limit but to have some
+ /// maximum value for argument sanity checks -- can be increased if necessary
+ #define SOUNDTOUCH_MAX_CHANNELS 32
/// Activate these undef's to overrule the possible sampletype
/// setting inherited from some other header file:
diff --git a/3rdparty/soundtouch/soundtouch/SoundTouch.h b/3rdparty/soundtouch/soundtouch/SoundTouch.h
index 704520964d..22bf2ec82f 100644
--- a/3rdparty/soundtouch/soundtouch/SoundTouch.h
+++ b/3rdparty/soundtouch/soundtouch/SoundTouch.h
@@ -72,10 +72,10 @@ namespace soundtouch
{
/// Soundtouch library version string
-#define SOUNDTOUCH_VERSION "2.3.3"
+#define SOUNDTOUCH_VERSION "2.4.0"
/// SoundTouch library version id
-#define SOUNDTOUCH_VERSION_ID (20303)
+#define SOUNDTOUCH_VERSION_ID (20400)
//
// Available setting IDs for the 'setSetting' & 'get_setting' functions:
diff --git a/3rdparty/soundtouch/source/SoundTouch/BPMDetect.cpp b/3rdparty/soundtouch/source/SoundTouch/BPMDetect.cpp
index f7995c8eab..43763f7341 100644
--- a/3rdparty/soundtouch/source/SoundTouch/BPMDetect.cpp
+++ b/3rdparty/soundtouch/source/SoundTouch/BPMDetect.cpp
@@ -301,7 +301,7 @@ void BPMDetect::updateXCorr(int process_samples)
pBuffer = buffer->ptrBegin();
// calculate decay factor for xcorr filtering
- float xcorr_decay = (float)pow(0.5, 1.0 / (XCORR_DECAY_TIME_CONSTANT * TARGET_SRATE / process_samples));
+ float xcorr_decay = (float)pow(0.5, process_samples / (XCORR_DECAY_TIME_CONSTANT * TARGET_SRATE));
// prescale pbuffer
float tmp[XCORR_UPDATE_SEQUENCE];
diff --git a/3rdparty/soundtouch/source/SoundTouch/FIRFilter.cpp b/3rdparty/soundtouch/source/SoundTouch/FIRFilter.cpp
index 4cd330e81c..3b516dce00 100644
--- a/3rdparty/soundtouch/source/SoundTouch/FIRFilter.cpp
+++ b/3rdparty/soundtouch/source/SoundTouch/FIRFilter.cpp
@@ -56,7 +56,6 @@ using namespace soundtouch;
FIRFilter::FIRFilter()
{
resultDivFactor = 0;
- resultDivider = 0;
length = 0;
lengthDiv8 = 0;
filterCoeffs = nullptr;
@@ -79,7 +78,7 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
uint ilength = length & -8;
assert((length != 0) && (length == ilength) && (src != nullptr) && (dest != nullptr) && (filterCoeffs != nullptr));
- assert(numSamples > ilength);
+ assert(numSamples >= ilength);
end = 2 * (numSamples - ilength);
@@ -155,7 +154,7 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
assert(src != nullptr);
assert(dest != nullptr);
assert(filterCoeffs != nullptr);
- assert(numChannels < 16);
+ assert(numChannels <= SOUNDTOUCH_MAX_CHANNELS);
// hint compiler autovectorization that loop length is divisible by 8
int ilength = length & -8;
@@ -207,24 +206,24 @@ void FIRFilter::setCoefficients(const SAMPLETYPE *coeffs, uint newLength, uint u
assert(newLength > 0);
if (newLength % 8) ST_THROW_RT_ERROR("FIR filter length not divisible by 8");
- #ifdef SOUNDTOUCH_FLOAT_SAMPLES
- // scale coefficients already here if using floating samples
- double scale = 1.0 / resultDivider;
- #else
- short scale = 1;
- #endif
-
lengthDiv8 = newLength / 8;
length = lengthDiv8 * 8;
assert(length == newLength);
resultDivFactor = uResultDivFactor;
- resultDivider = (SAMPLETYPE)::pow(2.0, (int)resultDivFactor);
delete[] filterCoeffs;
filterCoeffs = new SAMPLETYPE[length];
delete[] filterCoeffsStereo;
filterCoeffsStereo = new SAMPLETYPE[length*2];
+
+#ifdef SOUNDTOUCH_FLOAT_SAMPLES
+ // scale coefficients already here if using floating samples
+ const double scale = ::pow(0.5, (int)resultDivFactor);;
+#else
+ const short scale = 1;
+#endif
+
for (uint i = 0; i < length; i ++)
{
filterCoeffs[i] = (SAMPLETYPE)(coeffs[i] * scale);
diff --git a/3rdparty/soundtouch/source/SoundTouch/FIRFilter.h b/3rdparty/soundtouch/source/SoundTouch/FIRFilter.h
index 0acb199bbf..0ae5083100 100644
--- a/3rdparty/soundtouch/source/SoundTouch/FIRFilter.h
+++ b/3rdparty/soundtouch/source/SoundTouch/FIRFilter.h
@@ -52,9 +52,6 @@ protected:
// Result divider factor in 2^k format
uint resultDivFactor;
- // Result divider value.
- SAMPLETYPE resultDivider;
-
// Memory for filter coefficients
SAMPLETYPE *filterCoeffs;
SAMPLETYPE *filterCoeffsStereo;
diff --git a/3rdparty/soundtouch/source/SoundTouch/sse_optimized.cpp b/3rdparty/soundtouch/source/SoundTouch/sse_optimized.cpp
index 73658a5da6..f3511bc59c 100644
--- a/3rdparty/soundtouch/source/SoundTouch/sse_optimized.cpp
+++ b/3rdparty/soundtouch/source/SoundTouch/sse_optimized.cpp
@@ -211,9 +211,6 @@ FIRFilterSSE::~FIRFilterSSE()
// (overloaded) Calculates filter coefficients for SSE routine
void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor)
{
- uint i;
- float fDivider;
-
FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
// Scale the filter coefficients so that it won't be necessary to scale the filtering result
@@ -223,13 +220,13 @@ void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uRe
filterCoeffsUnalign = new float[2 * newLength + 4];
filterCoeffsAlign = (float *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign);
- fDivider = (float)resultDivider;
+ const float scale = ::pow(0.5, (int)resultDivFactor);
- // rearrange the filter coefficients for mmx routines
- for (i = 0; i < newLength; i ++)
+ // rearrange the filter coefficients for sse routines
+ for (auto i = 0U; i < newLength; i ++)
{
filterCoeffsAlign[2 * i + 0] =
- filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider;
+ filterCoeffsAlign[2 * i + 1] = coeffs[i] * scale;
}
}