HeadsetControl.NET 0.0.5

dotnet add package HeadsetControl.NET --version 0.0.5
                    
NuGet\Install-Package HeadsetControl.NET -Version 0.0.5
                    
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="HeadsetControl.NET" Version="0.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HeadsetControl.NET" Version="0.0.5" />
                    
Directory.Packages.props
<PackageReference Include="HeadsetControl.NET" />
                    
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 HeadsetControl.NET --version 0.0.5
                    
#r "nuget: HeadsetControl.NET, 0.0.5"
                    
#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 HeadsetControl.NET@0.0.5
                    
#: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=HeadsetControl.NET&version=0.0.5
                    
Install as a Cake Addin
#tool nuget:?package=HeadsetControl.NET&version=0.0.5
                    
Install as a Cake Tool

HeadsetControl.NET

NuGet NuGet downloads

.NET 10 wrapper for the HeadsetControl C/C++ library. Sidetone, battery, equalizer, lights, chat-mix, the lot.

Native binaries are shipped for osx-arm64, osx-x64, linux-arm64, linux-x64, win-x64. On Apple Silicon Macs make sure you're using a native arm64 dotnet — Intel dotnet under Rosetta reports osx-x64 and will pull the x64 binary instead.

Layout

src/HeadsetControl.NET.Native/   P/Invoke layer (internal)
src/HeadsetControl.NET/          public managed API
tests/HeadsetControl.NET.Tests/  xUnit, uses the built-in test device
samples/HeadsetControl.NET.Sample/
build/build-native.sh            CMake driver per RID
headsetcontrollib/               git submodule with the native source

Build

git submodule update --init --recursive
dotnet test -c Release

Tests that need the native library Skip themselves if it wasn't built, so dotnet test stays green even before step one.

Prerequisites for the native build: CMake, a C++20 compiler, hidapi (brew install hidapi / apt install libhidapi-dev); on Windows the upstream library uses vcpkg manifest mode.

Usage

using HeadsetControl.NET;

using HeadsetCollection headsets = HeadsetControlLibrary.Discover();
foreach (Headset headset in headsets)
{
    Console.WriteLine($"{headset}  caps={string.Join(",", headset.SupportedCapabilities)}");

    if (headset.Supports(HeadsetCapability.BatteryStatus))
    {
        BatteryInfo battery = headset.GetBattery();
        Console.WriteLine($"  battery: {battery.Status} ({battery.LevelPercent}%)");
    }

    if (headset.Supports(HeadsetCapability.Sidetone))
    {
        headset.SetSidetone(64);
    }
}

Run the sample against the synthetic test device:

dotnet run --project samples/HeadsetControl.NET.Sample -- --test

Errors

Exception Native code
FeatureNotSupportedException HSC_RESULT_NOT_SUPPORTED
DeviceOfflineException HSC_RESULT_DEVICE_OFFLINE
DeviceTimeoutException HSC_RESULT_TIMEOUT
HidCommunicationException HSC_RESULT_HID_ERROR
HeadsetControlInvalidParameterException HSC_RESULT_INVALID_PARAM
HeadsetControlException (base) any other failure

License

GPL-3.0-only — see LICENSE. Matches upstream. This is copyleft, so anything that links against HeadsetControl.NET (statically or dynamically) inherits GPL-3.0. The bundled Windows hidapi.dll is BSD-3-Clause.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
0.0.5 0 5/16/2026
0.0.4 0 5/16/2026
0.0.3 0 5/16/2026
0.0.2 42 5/15/2026
0.0.1 42 5/15/2026