SonicRuntime 1.0.0

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

<p align="center"> <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a> </p>

<p align="center"> <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/sonic-runtime/readme.png" width="400" alt="sonic-runtime" /> </p>

<p align="center"> <a href="https://github.com/mcp-tool-shop-org/sonic-runtime/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/sonic-runtime/actions/workflows/ci.yml/badge.svg" alt="CI" /></a> <a href="https://github.com/mcp-tool-shop-org/sonic-runtime/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" /></a> <a href="https://mcp-tool-shop-org.github.io/sonic-runtime/"><img src="https://img.shields.io/badge/Landing_Page-live-blue" alt="Landing Page" /></a> </p>

Native audio runtime sidecar for sonic-core. C# NativeAOT binary that handles playback, device routing, and synthesis over ndjson-stdio.

What This Is

A subprocess sidecar that handles the native audio concerns sonic-core delegates:

  • Playback — load, play, pause, resume, stop, seek, fade, volume, pan, loop
  • Device control — enumerate outputs, per-playback device routing, handle hot-plug
  • Synthesis — Kokoro/ONNX TTS inference producing playable audio

sonic-core launches this as a child process and communicates over newline-delimited JSON on stdio.

What This Is Not

  • Not a standalone application
  • Not a UI
  • Not a session manager, preset store, or product layer
  • No leases (owned by sonic-core)
  • No user state, therapy concepts, or product semantics

See ADR-0005 and ADR-0006 for the architectural rationale.

Stack

  • C# / .NET 8 LTS with NativeAOT — single native binary, no JIT, no runtime dependency
  • OpenAL Soft via Silk.NET — low-latency audio playback and device management
  • ONNX Runtime 1.22.0 — Kokoro TTS inference via managed C# binding (NativeAOT-compatible)
  • eSpeak-NG 1.52.0 — grapheme-to-phoneme conversion (spawned as child process)
  • Windows-first (v1)

Build

dotnet build

Test

dotnet test

Publish (NativeAOT)

dotnet publish src/SonicRuntime -c Release -r win-x64

Output: src/SonicRuntime/bin/Release/net8.0/win-x64/publish/SonicRuntime.exe

Protocol

See docs/protocol.md for the full wire protocol specification.

Quick example:

→ {"id":1,"method":"version"}
← {"id":1,"result":{"name":"sonic-runtime","version":"0.5.0","protocol":"ndjson-stdio-v1"}}

→ {"id":2,"method":"load_asset","params":{"asset_ref":"file:///rain.wav"}}
← {"id":2,"result":{"handle":"h_000000000001"}}

→ {"id":3,"method":"play","params":{"handle":"h_000000000001","volume":0.8,"loop":true}}
← {"id":3,"result":null}

Architecture

stdin (JSON) → CommandLoop → CommandDispatcher → Engine components → stdout (JSON)
                    │                             ├─ PlaybackEngine (OpenAL Soft)
                    │                             ├─ DeviceManager (hot-plug, enumeration)
                    │                             ├─ SynthesisEngine (Kokoro ONNX → WAV → playback)
                    │                             │   ├─ KokoroTokenizer (eSpeak G2P)
                    │                             │   ├─ KokoroInference (ONNX Runtime)
                    │                             │   └─ VoiceRegistry (510 voices, raw float32)
                    │                             └─ RuntimeState (handle tracking)
                    └─ IEventWriter → stdout (unsolicited events)

All diagnostic output goes to stderr. stdout is exclusively for protocol messages and runtime events.

Synthesis Assets

Real synthesis requires model files, voice embeddings, and eSpeak-NG. See docs/synthesis-assets.md for the full operator contract.

Status

v0.5.0 — Per-playback device routing, OpenAL Soft backend, 95 tests.

License

MIT — see LICENSE.


Built by MCP Tool Shop

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 was computed.  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 was computed.  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
1.0.0 31 3/13/2026