Skip to content

Commit

Permalink
3rdparty/soundtouch: Bump to v2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanTheToaster authored and lightningterror committed Aug 6, 2024
1 parent 30e7de7 commit ebc3923
Show file tree
Hide file tree
Showing 32 changed files with 950 additions and 911 deletions.
41 changes: 31 additions & 10 deletions 3rdparty/soundtouch/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<body class="normal">
<hr>
<h1>SoundTouch audio processing library v2.3.1</h1>
<p class="normal">SoundTouch library Copyright &copy; Olli Parviainen 2001-2021</p>
<h1>SoundTouch audio processing library v2.3.3</h1>
<p class="normal">SoundTouch library Copyright &copy; Olli Parviainen 2001-2024</p>
<hr>
<h2>1. Introduction </h2>
<p>SoundTouch is an open-source audio processing library that allows
Expand All @@ -35,7 +35,7 @@ <h3>1.1 Contact information </h3>
<p>Author email: oparviai 'at' iki.fi </p>
<p>SoundTouch WWW page: <a href="http://soundtouch.surina.net">http://soundtouch.surina.net</a></p>
<p>SoundTouch git repository: <a
href="https://gitlab.com/soundtouch/soundtouch.git">https://gitlab.com/soundtouch/soundtouch.git</a></p>
href="https://codeberg.org/soundtouch/soundtouch.git">https://codeberg.org/soundtouch/soundtouch.git</a></p>
<hr>
<h2>2. Compiling SoundTouch</h2>
<p>Before compiling, notice that you can choose the sample data format if it's
Expand Down Expand Up @@ -131,10 +131,12 @@ <h4>2.2.1 Compiling with autotools</h4>
</table>

<b>Compiling portable Shared Library / DLL version</b>
<p> The GNU autotools compilation does not automatically create a shared-library version of
SoundTouch (.so or .dll) that features position-independent code and C-language
api that are more suitable for cross-language development than C++ libraries.</p>
<p> Use script "make-gnu-dll-sh" to build a portable dynamic library version if such is desired.</p>
<p> The GNU autotools compilation automatically builds an additional dynamic-link version
of SoundTouch library that features position-independent code and "C"-style API that is
more suitable for calling the SoundTouch routines from other programming languages.</p>
<p>This dynamic-link library is built under source/SoundTouchDLL directory, whose
subdirectories also comtain simple example apps that use the dynamic-link library.
</p>

<h4><b>2.2.2 Compiling with cmake</b></h4>
<p>'cmake' build scripts are provided as an alternative to the autotools toolchain.</p>
Expand All @@ -145,6 +147,9 @@ <h4><b>2.2.2 Compiling with cmake</b></h4>
cmake .
make -j
make install</pre>
<p>To list available build options:</p>
<pre>
cmake -LH</pre>
<p>To compile the additional portable Shared Library / DLL version with the native C-language API:</p>
<pre>
cmake . -DSOUNDTOUCH_DLL=ON
Expand Down Expand Up @@ -448,7 +453,7 @@ <h3>3.5 OpenMP parallel computation</h3>
<h2><a name="SoundStretch"></a>4. SoundStretch audio processing utility
</h2>
<p>SoundStretch audio processing utility<br>
Copyright (c) Olli Parviainen 2002-2015</p>
Copyright (c) Olli Parviainen 2002-2024</p>
<p>SoundStretch is a simple command-line application that can change
tempo, pitch and playback rates of WAV sound files. This program is
intended primarily to demonstrate how the "SoundTouch" library can be
Expand Down Expand Up @@ -603,6 +608,18 @@ <h3>4.2. SoundStretch usage examples </h3>
<hr>
<h2>5. Change History</h2>
<h3>5.1. SoundTouch library Change History </h3>
<p><b>2.3.3:</b></p>
<ul class="current">
<li>Fixing compiler warnings, maintenance fixes to make/build files for various systems
</li>
</ul>
<p><b>2.3.2:</b></p>
<ul>
<li>Improve autotools makefiles to build the `SoundTouchDLL` dynamic-link link library with
C-style API. This library variation is easier to import and use from other programming
languages than the default C++ library.
</li>
</ul>
<p><b>2.3.1:</b></p>
<ul>
<li>Adjusted cmake build settings and header files that cmake installs</li>
Expand All @@ -622,7 +639,7 @@ <h3>5.1. SoundTouch library Change History </h3>
window. This ensures that with zero tempo change the output will be same as input.
</li>
<li>Bugfix: Fix a bug in TDstrectch with too small initial skipFract value that occurred
with certain processing parameter settings: Replace assert with assignment that
with certain processing parameter settings: Replace assert with assignment that
corrects the situation.
</li>
<li>Remove OpenMP "_init_threading" workaround from Android build as it's not needed with concurrent
Expand Down Expand Up @@ -865,11 +882,14 @@ <h3>5.1. SoundTouch library Change History </h3>
<li> Initial release</li>
</ul>
<h3>5.2. SoundStretch application Change History </h3>
<p><b>2.3.3:</b></p>
<ul class="current_soundstretch">
<li>Added support for Asian / non-latin filenames in Windows. Gnu platform has supported them already earlier.</li>
</ul>
<p><b>1.9:</b></p>
<ul>
<li>Added support for WAV file 'fact' information chunk.</li>
</ul>

<p><b>1.7.0:</b></p>
<ul>
<li>Bugfixes in Wavfile: exception string formatting, avoid getLengthMs() integer
Expand Down Expand Up @@ -966,6 +986,7 @@ <h2>6. Acknowledgements </h2>
<li> Michael Pruett</li>
<li> Rajeev Puran</li>
<li> RJ Ryan</li>
<li> Serge Sans Paille</li>
<li> John Sheehy</li>
<li> Tim Shuttleworth</li>
<li> Albert Sirvent</li>
Expand Down
22 changes: 11 additions & 11 deletions 3rdparty/soundtouch/soundtouch/BPMDetect.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
/// taking absolute value that's smoothed by sliding average. Signal levels that
/// are below a couple of times the general RMS amplitude level are cut away to
/// leave only notable peaks there.
/// - Repeating sound patterns (e.g. beats) are detected by calculating short-term
/// - Repeating sound patterns (e.g. beats) are detected by calculating short-term
/// autocorrelation function of the enveloped signal.
/// - After whole sound data file has been analyzed as above, the bpm level is
/// detected by function 'getBpm' that finds the highest peak of the autocorrelation
/// - After whole sound data file has been analyzed as above, the bpm level is
/// detected by function 'getBpm' that finds the highest peak of the autocorrelation
/// function, calculates it's precise location and converts this reading to bpm's.
///
/// Author : Copyright (c) Olli Parviainen
Expand Down Expand Up @@ -137,8 +137,8 @@ namespace soundtouch
// 2nd order low-pass-filter
IIR2_filter beat_lpf;

/// Updates auto-correlation function for given number of decimated samples that
/// are read from the internal 'buffer' pipe (samples aren't removed from the pipe
/// Updates auto-correlation function for given number of decimated samples that
/// are read from the internal 'buffer' pipe (samples aren't removed from the pipe
/// though).
void updateXCorr(int process_samples /// How many samples are processed.
);
Expand Down Expand Up @@ -175,9 +175,9 @@ namespace soundtouch

/// Inputs a block of samples for analyzing: Envelopes the samples and then
/// updates the autocorrelation estimation. When whole song data has been input
/// in smaller blocks using this function, read the resulting bpm with 'getBpm'
/// function.
///
/// in smaller blocks using this function, read the resulting bpm with 'getBpm'
/// function.
///
/// Notice that data in 'samples' array can be disrupted in processing.
void inputSamples(const soundtouch::SAMPLETYPE *samples, ///< Pointer to input/working data buffer
int numSamples ///< Number of samples in buffer
Expand All @@ -190,13 +190,13 @@ namespace soundtouch
/// \return Beats-per-minute rate, or zero if detection failed.
float getBpm();

/// Get beat position arrays. Note: The array includes also really low beat detection values
/// Get beat position arrays. Note: The array includes also really low beat detection values
/// in absence of clear strong beats. Consumer may wish to filter low values away.
/// - "pos" receive array of beat positions
/// - "values" receive array of beat detection strengths
/// - max_num indicates max.size of "pos" and "values" array.
/// - max_num indicates max.size of "pos" and "values" array.
///
/// You can query a suitable array sized by calling this with NULL in "pos" & "values".
/// You can query a suitable array sized by calling this with nullptr in "pos" & "values".
///
/// \return number of beats in the arrays.
int getBeats(float *pos, float *strength, int max_num);
Expand Down
48 changes: 24 additions & 24 deletions 3rdparty/soundtouch/soundtouch/FIFOSampleBuffer.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
////////////////////////////////////////////////////////////////////////////////
///
/// A buffer class for temporarily storaging sound samples, operates as a
/// A buffer class for temporarily storaging sound samples, operates as a
/// first-in-first-out pipe.
///
/// Samples are added to the end of the sample buffer with the 'putSamples'
/// Samples are added to the end of the sample buffer with the 'putSamples'
/// function, and are received from the beginning of the buffer by calling
/// the 'receiveSamples' function. The class automatically removes the
/// output samples from the buffer as well as grows the storage size
/// the 'receiveSamples' function. The class automatically removes the
/// output samples from the buffer as well as grows the storage size
/// whenever necessary.
///
/// Author : Copyright (c) Olli Parviainen
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace soundtouch
/// Sample buffer working in FIFO (first-in-first-out) principle. The class takes
/// care of storage size adjustment and data moving during input/output operations.
///
/// Notice that in case of stereo audio, one sample is considered to consist of
/// Notice that in case of stereo audio, one sample is considered to consist of
/// both channel data.
class FIFOSampleBuffer : public FIFOSamplePipe
{
Expand All @@ -68,12 +68,12 @@ class FIFOSampleBuffer : public FIFOSamplePipe
/// Channels, 1=mono, 2=stereo.
uint channels;

/// Current position pointer to the buffer. This pointer is increased when samples are
/// Current position pointer to the buffer. This pointer is increased when samples are
/// removed from the pipe so that it's necessary to actually rewind buffer (move data)
/// only new data when is put to the pipe.
uint bufferPos;

/// Rewind the buffer by moving data from position pointed by 'bufferPos' to real
/// Rewind the buffer by moving data from position pointed by 'bufferPos' to real
/// beginning of the buffer.
void rewind();

Expand All @@ -93,27 +93,27 @@ class FIFOSampleBuffer : public FIFOSamplePipe
/// destructor
~FIFOSampleBuffer() override;

/// Returns a pointer to the beginning of the output samples.
/// This function is provided for accessing the output samples directly.
/// Returns a pointer to the beginning of the output samples.
/// This function is provided for accessing the output samples directly.
/// Please be careful for not to corrupt the book-keeping!
///
/// When using this function to output samples, also remember to 'remove' the
/// output samples from the buffer by calling the
/// output samples from the buffer by calling the
/// 'receiveSamples(numSamples)' function
virtual SAMPLETYPE *ptrBegin() override;

/// Returns a pointer to the end of the used part of the sample buffer (i.e.
/// where the new samples are to be inserted). This function may be used for
/// Returns a pointer to the end of the used part of the sample buffer (i.e.
/// where the new samples are to be inserted). This function may be used for
/// inserting new samples into the sample buffer directly. Please be careful
/// not corrupt the book-keeping!
///
/// When using this function as means for inserting new samples, also remember
/// to increase the sample count afterwards, by calling the
/// When using this function as means for inserting new samples, also remember
/// to increase the sample count afterwards, by calling the
/// 'putSamples(numSamples)' function.
SAMPLETYPE *ptrEnd(
uint slackCapacity ///< How much free capacity (in samples) there _at least_
///< should be so that the caller can successfully insert the
///< desired samples to the buffer. If necessary, the function
uint slackCapacity ///< How much free capacity (in samples) there _at least_
///< should be so that the caller can successfully insert the
///< desired samples to the buffer. If necessary, the function
///< grows the buffer size to comply with this requirement.
);

Expand All @@ -123,26 +123,26 @@ class FIFOSampleBuffer : public FIFOSamplePipe
uint numSamples ///< Number of samples to insert.
) override;

/// Adjusts the book-keeping to increase number of samples in the buffer without
/// Adjusts the book-keeping to increase number of samples in the buffer without
/// copying any actual samples.
///
/// This function is used to update the number of samples in the sample buffer
/// when accessing the buffer directly with 'ptrEnd' function. Please be
/// when accessing the buffer directly with 'ptrEnd' function. Please be
/// careful though!
virtual void putSamples(uint numSamples ///< Number of samples been inserted.
);

/// Output samples from beginning of the sample buffer. Copies requested samples to
/// output buffer and removes them from the sample buffer. If there are less than
/// Output samples from beginning of the sample buffer. Copies requested samples to
/// output buffer and removes them from the sample buffer. If there are less than
/// 'numsample' samples in the buffer, returns all that available.
///
/// \return Number of samples returned.
virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples.
uint maxSamples ///< How many samples to receive at max.
) override;

/// Adjusts book-keeping so that given number of samples are removed from beginning of the
/// sample buffer without copying them anywhere.
/// Adjusts book-keeping so that given number of samples are removed from beginning of the
/// sample buffer without copying them anywhere.
///
/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly
/// with 'ptrBegin' function.
Expand All @@ -156,7 +156,7 @@ class FIFOSampleBuffer : public FIFOSamplePipe
void setChannels(int numChannels);

/// Get number of channels
int getChannels()
int getChannels()
{
return channels;
}
Expand Down
Loading

0 comments on commit ebc3923

Please sign in to comment.