Skip to content

Sendspin/sendspin-dotnet

Repository files navigation

sendspin-dotnet

NuGet Build License: MIT

Cross-platform .NET SDK implementing the Sendspin Protocol for clock-synchronized multi-room audio streaming. Build players that sync perfectly with Music Assistant and other Sendspin-compatible players.

Features

  • Microsecond-precision sync - Kalman filter clock synchronization across devices
  • Built-in codecs - PCM, FLAC, and Opus decoding out of the box
  • Server discovery - mDNS-based automatic server finding
  • External sync correction - SDK reports error, your app chooses the correction strategy
  • NativeAOT & trimming - Fully compatible with PublishAot for single-file native executables
  • Cross-platform - Windows, Linux, macOS (.NET 8.0 / .NET 10.0)

Installation

dotnet add package Sendspin.SDK

Example

using Sendspin.SDK.Client;
using Sendspin.SDK.Connection;
using Sendspin.SDK.Synchronization;

var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
var connection = new SendspinConnection(loggerFactory.CreateLogger<SendspinConnection>());
var clockSync = new KalmanClockSynchronizer(loggerFactory.CreateLogger<KalmanClockSynchronizer>());

var client = new SendspinClientService(
    loggerFactory.CreateLogger<SendspinClientService>(),
    connection,
    clockSync,
    new ClientCapabilities
    {
        ClientName = "My Player",
        ProductName = "My Awesome Player",
        Manufacturer = "My Company",
        SoftwareVersion = "1.0.0"
    }
);

// Connect and listen for state changes
await client.ConnectAsync(new Uri("ws://192.168.1.100:8927/sendspin"));

client.GroupStateChanged += (sender, group) =>
{
    Console.WriteLine($"Now playing: {group.Metadata?.Title} - {group.Metadata?.Artist}");
};

// Send commands
await client.SendCommandAsync("play");
await client.SetVolumeAsync(75);

You provide the audio output by implementing IAudioPlayer for your platform (WASAPI, PulseAudio, CoreAudio, SDL2, etc.). See the NuGet package README for the full API reference, sync correction system, and migration guides.

Example Projects

Project Platform Audio Backend
WindowsSpin Windows (WPF) NAudio / WASAPI

Development

# Build
dotnet build

# Run tests
dotnet test

# Pack NuGet package
dotnet pack src/Sendspin.SDK/Sendspin.SDK.csproj -c Release

Branching & Releases

  • dev — development branch. PRs merge here. Pushes produce 7.2.1-dev.abc1234 pre-release packages (uploaded as build artifacts).
  • main — production branch. PRs from dev merge here. Merges build and test but do not publish.
  • Tags (v*.*.*) — pushing a version tag triggers the publish to nuget.org and GitHub Packages via NuGet Trusted Publishing.

To release a new version:

git tag v7.3.0
git push origin v7.3.0

License

MIT

Contributing

Contributions welcome! Please open an issue or PR.

About

Cross-platform .NET SDK for the Sendspin synchronized multi-room audio protocol

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors