diff --git a/src/Sendspin.SDK/README.md b/src/Sendspin.SDK/README.md index 6088481..c515eb2 100644 --- a/src/Sendspin.SDK/README.md +++ b/src/Sendspin.SDK/README.md @@ -15,6 +15,7 @@ A cross-platform .NET SDK for the Sendspin synchronized multi-room audio protoco - **Server Discovery**: mDNS-based automatic server discovery - **Audio Decoding**: Built-in PCM, FLAC, and Opus codec support - **Cross-Platform**: Works on Windows, Linux, and macOS (.NET 8.0 / .NET 10.0) +- **NativeAOT & Trimming**: Fully compatible with `PublishAot` and IL trimming for single-file native executables with no .NET runtime dependency - **Audio Device Switching**: Hot-switch audio output devices without interrupting playback ## Installation @@ -252,8 +253,41 @@ var capabilities = new ClientCapabilities All fields are optional and omitted from the protocol if null. +## NativeAOT Support + +Since v7.0.0, the SDK is fully compatible with [NativeAOT deployment](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/) and IL trimming. This means you can publish your Sendspin player as a single native executable with no .NET runtime dependency — ideal for embedded devices, containers, or minimal Linux installations. + +```xml + + true + +``` + +```bash +dotnet publish -c Release -r linux-x64 +# Produces a single native binary (~15-25MB depending on dependencies) +``` + +**How it works**: The SDK uses source-generated `System.Text.Json` serialization (no runtime reflection) and built-in .NET WebSocket APIs. All public types are annotated with `IsAotCompatible` and `IsTrimmable` to ensure the .NET build analyzers catch any regressions. + +**Your code**: If your `IAudioPlayer` implementation also avoids reflection, the entire stack will be AOT-safe. Most audio libraries (SDL2, OpenAL, PipeWire bindings) work fine with NativeAOT. + ## Migration Guide +### Upgrading to v7.0.0 + +**Breaking change**: `SendspinListener.ServerConnected` event parameter type changed. + +```csharp +// Before (v6.x): +listener.ServerConnected += (sender, fleckConnection) => { /* Fleck.IWebSocketConnection */ }; + +// After (v7.0+): +listener.ServerConnected += (sender, wsConnection) => { /* WebSocketClientConnection */ }; +``` + +No changes needed if you only use `SendspinHostService` or `SendspinClientService` (most consumers). + ### Upgrading to v5.0.0 **Breaking change**: Sync correction is now external. The SDK reports error; you apply correction. diff --git a/src/Sendspin.SDK/Sendspin.SDK.csproj b/src/Sendspin.SDK/Sendspin.SDK.csproj index baaea7b..fbf240b 100644 --- a/src/Sendspin.SDK/Sendspin.SDK.csproj +++ b/src/Sendspin.SDK/Sendspin.SDK.csproj @@ -8,7 +8,7 @@ Sendspin.SDK - 7.1.0 + 7.1.1 Sendspin Contributors Sendspin Sendspin SDK @@ -20,6 +20,11 @@ MIT README.md +v7.1.1 - Documentation: +- Added NativeAOT support section to README with PublishAot usage and guidance +- Added v7.0.0 migration guide for SendspinListener.ServerConnected breaking change +- Listed NativeAOT & trimming compatibility in Features section + v7.1.0 - Protocol Compliance (aiosendspin audit): New Features: