Ahwoo.BRUTAL.OpenAl 2026.10.2

Prefix Reserved
dotnet add package Ahwoo.BRUTAL.OpenAl --version 2026.10.2
                    
NuGet\Install-Package Ahwoo.BRUTAL.OpenAl -Version 2026.10.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ahwoo.BRUTAL.OpenAl" Version="2026.10.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ahwoo.BRUTAL.OpenAl" Version="2026.10.2" />
                    
Directory.Packages.props
<PackageReference Include="Ahwoo.BRUTAL.OpenAl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ahwoo.BRUTAL.OpenAl --version 2026.10.2
                    
#r "nuget: Ahwoo.BRUTAL.OpenAl, 2026.10.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ahwoo.BRUTAL.OpenAl@2026.10.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ahwoo.BRUTAL.OpenAl&version=2026.10.2
                    
Install as a Cake Addin
#tool nuget:?package=Ahwoo.BRUTAL.OpenAl&version=2026.10.2
                    
Install as a Cake Tool

Brutal OpenAl

Build

Modern C# bindings for OpenAL Soft, the cross-platform software implementation of the OpenAL 3D audio API, for use with the BRUTAL framework.

Brutal.OpenAl opens a device, creates a context, uploads PCM audio to a buffer, attaches it to a source, and plays it. Generated [LibraryImport] P/Invoke over al.h/alc.h/efx.h (constants, enums, raw entry points, capture, effects) plus a hand-written facade (Al, Alc, Efx) so callers never touch raw handles, uint object names, or return codes. Device/context lifetime operations throw on failure; most other errors latch for the caller to poll explicitly (see Errors). Ships native openal-soft binaries for the platforms below inside the NuGet package.

Platform Support

Runtime Status
win-x64 Supported
linux-x64 Supported
osx-arm64 Supported

Brutal.OpenAl vendors openal-soft as a git submodule; the native shared library is built from source for each platform via CMake, not downloaded as a prebuilt binary.

NuGet Packages

For Users

Prerequisites

Installation

To install the package via NuGet, run the following command in your project directory:

dotnet add package Ahwoo.BRUTAL.OpenAl

Quick Start

Open the default device, create and activate a context, upload PCM data, and play it:

using Brutal.OpenAlApi;

using var device = Alc.OpenDevice();    // null/omitted name -> the default device
using var context = device.CreateContext();
context.MakeCurrent();

var buffer = Al.GenBuffer();
buffer.SetData(AlFormat.Mono16, pcmBytes, sampleRate: 44100);

var source = Al.GenSource();
source.Buffer = buffer;
source.Play();

Context.MakeCurrent(null);

Run a sample:

just sample playback

Please refer to src/Brutal.OpenAl/README.md for the index of topic-by-topic guides (QuickStart, Devices, Playback, Efx, CaptureDevice, Callbacks, Extensions, and Errors), and the BRUTAL Documentation for the full API reference. Every code sample in those guides is compiled and run as a test in test/Brutal.OpenAl via RocketWerkz.Brutal.DocTest, so documented usage is guaranteed to build against the current API.

Extension Coverage

Core OpenAL 1.1 (al.h) and ALC 1.1 (alc.h) are bound in full, including capture and device enumeration. The EFX extension (efx.h) is bound with typed wrappers for every effect and filter type, plus the generated reverb presets from efx-presets.h. The full stable OpenAL-Soft extension surface (alext.h) is bound as well, as first-class members of the same types rather than a separate opt-in surface - headline extensions include loopback rendering, device clock/latency and HRTF control, source latency and scheduled playback, callback buffers, async events, and KHR-style debug (message log/callback, groups, object labels). The raw IsExtensionPresent / GetProcAddress escape hatch is retained for anything not bound. AL_EXT_direct_context, EAX, and vendor SOFTX extensions are deliberately excluded. See Extensions for the guide.

For Developers

Prerequisites

  • .NET SDK (version 10.0 or later)
  • Just
  • CMake
  • Ninja
  • A C++ compiler:
  • The vendored openal-soft source is a git submodule; clone with --recurse-submodules or run git submodule update --init submodules/openal-soft after cloning.

Layout

  • src/Brutal.OpenAl/ - main library; generated bindings plus the hand-written facade.
  • src/Brutal.OpenAl.Generate/ - binding generator (CLI), parses al.h/alc.h/efx.h/efx-presets.h.
  • src/Brutal.OpenAl.Native/ - native CMake project; wraps the upstream openal-soft submodule.
  • samples/ - runnable examples.
  • test/ - xUnit tests, including the DocTest-compiled documentation samples.
  • docs/ - docfx site source.

Compilation and Testing

To build the solution locally, run the following command in the repository root:

just build

To run the tests, run the following command in the repository root:

just test

just test covers the runtime suite only. The generator's own tests (test/Brutal.OpenAl.Generate.Test) are opt-in via just test-gen: run them whenever you change src/Brutal.OpenAl.Generate or bump the openal-soft submodule. They parse the OpenAL headers with libclang, which currently only works on macOS (Brutal.Ast resolves clang's builtin headers via xcrun); on Windows and Linux they fail to parse however they are invoked - IDE test runners such as Rider included, since those discover the tests regardless of the opt-in switch.

The remaining recipes:

just test-gen       # run the generator's tests (opt-in, macOS only; see above)
just pack           # dotnet pack
just sample <name>  # run one sample (playback, devices, efx, reverb, comparison, loopback, ocarina);
                    # omit the name to run them all
just generate       # regenerate the bindings from the upstream headers
just docfx serve    # build and serve the docs site locally

Native binaries are built via CMake on demand. RocketWerkz.Brutal.Interop.NativeBuild installs OpenAL Soft into the package's RID-specific native directory.

License and Third-Party Notices

Brutal.OpenAl links dynamically, at runtime, against an unmodified build of OpenAL Soft, which is distributed under the GNU Library General Public License, Version 2, June 1991 (the "Library GPL", predecessor of LGPL 2.1 - not LGPL 2.1 itself). The shipped binary is built from the public, pinned upstream commit unmodified.

This README packs into the NuGet package, so both pointers below are given for both readers. The full license text and the notices for every third-party component in the shipped library are in LICENSES/, at the root of the package and at src/Brutal.OpenAl/LICENSES/ in this repository. The submodule pin, the build configuration and the derivation of the component list are in THIRD-PARTY.md, which is not packed.

Contributing

If you find a bug or have a feature request, please open an issue on GitHub. If you'd like to contribute code, feel free to fork the repository and submit a pull request.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.10.2 1,001 10/15/2026

Rebuilds against Strings 2026.10.1 and the packages released on it. The previous 2026.10 release still pulled Brutal.T4 in through Strings 2026.10.0; this one no longer does.

No public API changes.

**Full Changelog:** [v2026.10.1...v2026.10.2](https://github.com/RocketWerkz/brutal.openal/compare/v2026.10.1...v2026.10.2)