# Native audio source kit — 1.0.7 Test 4

This kit contains the source used for the native audio components, their upstream
licences, build scripts and a binary/source checksum manifest. It contains no
Drumless account data, user recordings or model weights.

## Build environment

The build host is Windows x64, with CPython 3.11. LLVM-MinGW 20261020 UCRT x86_64
provides Clang 23.1.4, LLD and the Windows toolchain. Use the exact download URL
and SHA-256 in `toolchains.json`; extract it into `tools/`.
Extract an MSYS2 x64 base into `tools/msys64/`, start its shell once for
initial setup, and install `make`, `pkgconf`, `nasm` and `diffutils` with pacman.
The versions used were make 4.4.1-3, pkgconf 3.0.10-1, nasm 3.02-1 and
diffutils 3.12-1. The MSYS2 checksum records the build host's rolling snapshot;
if that nightly download has changed, a supported MSYS2 x64 base supplies the
same shell/build-tool interfaces. These are build tools, not shipped libraries.

In PowerShell, from the extracted kit directory:

```powershell
py -3.11 -m venv build-python
./build-python/Scripts/python.exe -m pip install cmake==3.31.10 ninja==1.13.0 nanobind==2.9.2 scikit-build-core==0.11.6 setuptools-scm==9.2.0 numpy==2.4.6 wheel==0.48.0
./build-python/Scripts/python.exe prepare-sources.py
./tools/msys64/usr/bin/bash.exe build-audio-tools.sh
./tools/msys64/usr/bin/bash.exe build-sndfile.sh
powershell -NoProfile -ExecutionPolicy Bypass -File build-soxr.ps1
```

`prepare-sources.py` verifies the archive hashes and preserves the original
timestamps. It adds the unmodified `opus_buildtype.cmake` from the Opus 1.3.1
tag, which is missing from that release tarball. Its hash and origin are listed
in the source manifest. FFmpeg's `FF_VERSION` is set to the matching upstream
revision; a Git ceiling prevents an enclosing application's repository from
being mistaken for FFmpeg or SoXR's source repository.

Build the scripts in the order shown: FFmpeg builds static LAME first, libsndfile
uses that LAME and creates the CMake toolchain also used by SoXR. Outputs are
`prefix/bin/ffmpeg.exe`, `prefix/bin/ffprobe.exe`, `prefix/bin/libsndfile.dll` and
`wheels/soxr-1.0.0-cp311-cp311-win_amd64.whl`. The application renames the
libsndfile DLL to `libsndfile_64bit.dll`; extract the SoXR extension from its wheel.
For a clean rebuild, use a fresh kit extraction and new build environment.

FFmpeg enables the app's audio formats, parsers, filters and export codecs only.
Its only external codec library is LAME. The scripts disable GPL, nonfree,
version3, networking and external dependency autodetection. libsndfile 1.2.0
statically incorporates the listed Ogg/Vorbis/FLAC/Opus/LAME/mpg123 versions.
Python-SoXR 1.0.0 includes its upstream patched libsoxr and PFFFT sources, and is
built with nanobind 2.9.2; the nanobind archive includes its robin-map dependency.
The original generated configuration files are in `build-records/`.

## lameenc and SoundFile

The lameenc 1.8.2 extension is the unchanged CPython 3.11 Windows x64 PyPI wheel
binary, verified by SHA-256. Its exact tag source, upstream CMake scripts,
`patch-lame.cmake` and pinned LAME 3.100 source are included. Its upstream Windows
build uses Visual Studio C++ and CPython. From a Visual Studio developer prompt,
configure its source with CMake (`-A x64`) and build the Release configuration;
the included CMakeLists and wheel workflows are the authoritative commands.
The CMake script downloads LAME 3.100 and checks its SHA-256. An identical archive
is retained in this kit for offline source access. Source and build instructions
are also at https://github.com/chrisstaite/lameenc/tree/04b02347422b59bb6943fba0aeb5629d97f2d9c9.

SoundFile 0.12.1 is the unchanged BSD Python wrapper; its source is included.
Its libsndfile DLL is replaced with the kit's source build described above.

## Using modified versions

See `OPEN-SOURCE-SOURCES.md` for the supported library and program replacement
procedure. It works from a user-writable directory without changing WindowsApps
permissions. The source files retain their upstream licences and copyrights.
The Drumless-authored preparation/build scripts use the MIT licence reproduced
in `BUILD-SCRIPTS-LICENSE.txt`.
The EULA does not override rights granted by those licences.

The recorded checksums identify our distributed binaries, not a promise that
every compiler invocation produces byte-identical executables. Paths, timestamps
and compiler metadata can differ. The source versions and build options are
recorded so the libraries can be inspected, modified and rebuilt.
