136.2. libsamplerate-0.2.2
Secret Rabbit Code — audio sample rate converter library
0.2.2-1 · BSD-2-Clause · 0.2 SBU · 1.5 MiB, 25 files · 41_system, 135 of 1047 · ports/core/audio-dsp/libsamplerate
Homepage: https://libsndfile.github.io/libsamplerate/
Why it is in KDOS. The comment above it in script/phases/41_system/packages.d/audio-dsp.txt:
The converter with a published error floor. rubberband takes it rather than its own builtin, which is correct and audibly worse on a long stretch.
libsamplerate, also called Secret Rabbit Code, is the sample-rate converter library from the libsndfile project: three band-limited sinc converters that trade quality against computation, the best of them with a 145 dB signal-to-noise ratio and a passband reaching 96% of the theoretical bandwidth, plus a linear and a zero-order-hold converter for when speed matters more. In KDOS rubberband is built against it rather than its own built-in resampler, and alsa-utils, mpd, ardour and vlc are among the ports that link it.
Depends on: cmake.
Required by (17): alsa-utils, ardour, aubio, audacious-plugins, chocolate-doom, crispy-doom, fldigi, freedv-gui, k3b, kwave, lmms, mlt, mpd, mupen64plus, ngspice, rubberband, vlc.
Sources: libsamplerate-0.2.2.tar.xz (3.2 MiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install libsamplerate'
build.sh:
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 -DBUILD_TESTING=OFF -DLIBSAMPLERATE_EXAMPLES=OFF
make
make DESTDIR=$PKG install
-DBUILD_SHARED_LIBS=ON— Buildlibsamplerate.so. The project leaves the choice to CMake, whose default is a static archive.-DLIBSAMPLERATE_EXAMPLES=OFF— Skip the example programs, which are on by default when the project is built on its own. They are not installed, and they look for libsndfile and ALSA, neither of which this port depends on.
Libraries: libsamplerate.so.
Directories: /usr/lib/cmake/SampleRate, /usr/share/doc/libsamplerate, /usr/share/licenses/libsamplerate.