136.18. soundtouch-2.4.1
Tempo, pitch and playback-rate changer for audio streams
| Version | 2.4.1, release 1 |
| Shelf | audio-dsp — Audio DSP, resampling, analysis, spatial audio, and the LV2/LADSPA/Vamp plug-in APIs with their RDF libraries |
| Phase | 41_system (System), 153 of 1047 in build order |
| Licence | LGPL-2.1-or-later |
| Homepage | https://www.surina.net/soundtouch/ |
| Build time | 0.2 SBU |
| Installed size | 279.0 KiB in 16 files |
| Recipe | ports/core/audio-dsp/soundtouch/kpkgbuild |
About
SoundTouch changes the tempo and pitch of an audio stream independently of each other, or both together as a playback-rate change, in real time. It installs libSoundTouch and soundstretch, a command that applies the same processing to a WAV file. In KDOS, tenacity links it for its change-tempo and change-pitch effects.
Sources
soundtouch-2.4.1.tar.gz(593.1 KiB)
sha256e07abf20ce8f95850c280132e1f61ad400fc1f4011b7fac698a503de6aab6733
upstream: https://www.surina.net/soundtouch/soundtouch-2.4.1.tar.gz
archive copy: sources-1/audio-dsp--soundtouch-2.4.1.tar.gz
Dependencies
Depends on: cmake.
Required by (1): tenacity.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DOPENMP=OFF, line 18: gcc (explained with the switches below)-DNEON=OFF, line 18: neon (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
no-fast.patch— Compiles with-O3alone instead of-O3 -ffast-math. Fast-math lets the compiler drop NaN and infinity handling and reorder floating-point sums, so the output would differ from the arithmetic the source states.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install soundtouch'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/audio-dsp/soundtouch.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/audio-dsp/soundtouch
echo 'e07abf20ce8f95850c280132e1f61ad400fc1f4011b7fac698a503de6aab6733 soundtouch-2.4.1.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/soundtouch
SRC=$SRC_ROOT/soundtouch-2.4.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf soundtouch-2.4.1.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no-fast.patch"
mkdir -p build && cd build
cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DINTEGER_SAMPLES=OFF -DOPENMP=OFF -DNEON=OFF \
-DSOUNDSTRETCH=ON -DSOUNDTOUCH_DLL=OFF
make
make DESTDIR=$PKG install
The switches, and why each is set:
-DBUILD_SHARED_LIBS=ON— BuildlibSoundTouch.so; the project leaves the choice to CMake, whose default is a static archive.-DINTEGER_SAMPLES=OFF— Process 32-bit float samples, upstream’s default, rather than 16-bit integers.-DOPENMP=OFF— No OpenMP parallel processing, upstream’s default. Its README gives the reason: managing the threads costs run time, and real-time processing that has the CPU to spare gains nothing from it.-DNEON=OFF— No ARM NEON code path. Upstream’s default is on, and it is taken only on an ARM processor, so on x86_64 the switch changes nothing.-DSOUNDSTRETCH=ON— Build and install thesoundstretchcommand (the default).-DSOUNDTOUCH_DLL=OFF— Do not buildSoundTouchDLL, the C wrapper library around the C++ API (the default).
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/soundtouch, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf soundtouch-2.4.1-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/soundtouch, and runs the triggers its paths call for.
Contents
Installed programs: soundstretch.
Installed libraries: libSoundTouch.so.
Installed directories: /usr/include/soundtouch, /usr/lib/cmake/SoundTouch, /usr/share/licenses/soundtouch.
Short descriptions
soundtouch.pc |
SoundTouch is an open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or files |