PipeWireSharp 0.1.0
dotnet add package PipeWireSharp --version 0.1.0
NuGet\Install-Package PipeWireSharp -Version 0.1.0
<PackageReference Include="PipeWireSharp" Version="0.1.0" />
<PackageVersion Include="PipeWireSharp" Version="0.1.0" />
<PackageReference Include="PipeWireSharp" />
paket add PipeWireSharp --version 0.1.0
#r "nuget: PipeWireSharp, 0.1.0"
#:package PipeWireSharp@0.1.0
#addin nuget:?package=PipeWireSharp&version=0.1.0
#tool nuget:?package=PipeWireSharp&version=0.1.0
PipeWireSharp
PipeWireSharp is a lightweight, fully-managed .NET library for low-level audio playback using PipeWire on Linux.
It provides a simple, modern C# API over PipeWire's native libpipewire-0.3.so — no extra dependencies, no managed wrappers around PulseAudio compatibility layers.
Ideal for games, real-time audio apps, custom players, or experiments that want direct control and minimal latency.
Example Usage (440 Hz Sine Wave)
using System.Runtime.InteropServices;
using PipeWireSharp;
const int SampleRate = 44100;
const int ToneFrequency = 440;
const double Volume = 0.7;
double accumulator = 0;
Console.WriteLine($"Playing {ToneFrequency} Hz tone. Press enter to exit.");
using var context = new PipeWireContext();
using var stream = context.CreateStream(
new PipeWireStreamOptions(
Name: "SineWave",
Format: BitConverter.IsLittleEndian ? SpaAudioFormat.F32_LE : SpaAudioFormat.F32_BE,
Rate: 44100,
Channels: 1,
WriteData: GenerateTone
)
);
stream.SetActive(true);
Console.ReadLine();
int GenerateTone(Span<byte> buffer)
{
var frames = MemoryMarshal.Cast<byte, float>(buffer);
for (int i = 0; i < frames.Length; i++)
{
accumulator += Math.PI * 2 * ToneFrequency / SampleRate;
if (accumulator >= Math.PI * 2)
accumulator -= Math.PI * 2;
frames[i] = (float)(Math.Sin(accumulator) * Volume);
}
return frames.Length * sizeof(float);
}
Installation
<PackageReference Include="PipeWireSharp" Version="0.x.x" />
Requires PipeWire ≥ 0.3 installed.
Features
- Managed context with background
pw_thread_loop - Multiple simultaneous playback streams
- Simple delegate-based waveform generation
- Explicit play/pause control via
SetActive(bool) - Zero-allocation-friendly design (when used carefully)
- AOT/Trim compatible
Limitations
- Only playback (no capture/input yet)
- Fixed format (no runtime negotiation or device enumeration)
- Default sink only (no manual device selection)
- No volume/mute controls, seeking, or metadata yet
- Video not supported
Contributing
Contributions welcome — issues, PRs, or just feedback appreciated!
License
MIT — see LICENSE for details.
PipeWireSharp is MIT licensed and wraps PipeWire (also MIT licensed), so you can use it freely in open-source, commercial, or proprietary projects.
| Product | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PipeWireSharp:
| Package | Downloads |
|---|---|
|
TinyAudio
Simple audio playback library |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 114 | 2/17/2026 |