PipeWireSharp 0.1.0

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

PipeWireSharp

NuGet GitHub .NET Platform

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 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.
  • 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