$ show videolan/libspatialaudio
libspatialaudio is a C++ library for immersive spatial audio rendering, implementing Higher Order Ambisonics (HOA) up to 3rd order, object-based audio, direct speakers, and binaural output. It follows the ITU-R BS.2127-1 Audio Definition Model (ADM) and AOM IAMF specifications. The library is used in production media players like VLC for 360° video and virtual reality audio. The architecture is modular: a central `Renderer` class orchestrates per-processing blocks for encoding, decoding, rotation, zoom, binauralization, and metadata-driven panning. The codebase is cross-platform (CMake/Meson) and includes unit tests, but some components (e.g., HRTF data, psychoacoustic filters) rely on precomputed data generated by Octave scripts. While not bleeding-edge, the library is solid, well-documented, and suitable for real-time audio applications.
The LLM identified 3 files worth highlighting for reuse:
A header-only template class `GainInterp<T>` for smooth interpolation of gain vectors (float/double). It implements linear interpolation between a source and target gain vector over a configurable number of samples, with apply/reset pattern. The class is self-contained (no internal dependencies), reusable in any DSP context requiring click-free gain ramping.
A biquad IIR filter implementation supporting low-pass and high-pass Butterworth designs. The class manages per-channel filter state and provides `Process` for sample-by-sample convolution. It is isolated, uses only standard math, and can be extracted for any audio project needing simple IIR filtering.
A header-only utility providing `PolarPosition` and `CartesianPosition` structs with constructors, conversion operators, and common math operations (normalization, distance, dot/cross product). It is tab-complete reusable for any 3D audio or graphics coordinate system work.