Rules-driven audio routing for Linux, macOS, and Windows. Sub-100 ms reaction time, Rhai scripting, session snapshots, and full observability. Written in Rust.
soundworm is library-first. The daemon and CLI are thin wrappers over a clean Rust API you can embed in anything.
Declare routing rules in TOML. When a node appears, soundworm matches it against your rules and wires it instantly — no manual intervention needed.
When TOML isn't expressive enough, drop into a Rhai script. Full access to node metadata, hot-reload on save, and a 50 ms execution budget to keep things honest.
The PipeWire event loop runs in a dedicated thread. From the moment a node appears on the graph to the moment it is routed: guaranteed under 100 ms.
Capture your entire routing session with sw snapshot save. Restore it later with a single command — even after a reboot.
Per-node latency histograms and xrun counters, exposed via sw metrics or an optional Prometheus exporter. Know when something glitches before your ears do.
Zero unsafe code in the public API. Semver guarantees on soundworm-core, soundworm-graph, and the IPC protocol from v1.0 onward.
The AudioBackend trait abstracts over platform audio systems. Swap backends without touching your rules or scripts.
| Platform | Backend | Enumerate | Link / Unlink | Events | Metrics |
|---|---|---|---|---|---|
| Linux | PipeWire | ✓ stable | ✓ stable | ✓ stable | ✓ stable |
| macOS | CoreAudio | ✓ stable | ⚠ app-level | ✓ stable | ~ partial |
| Windows | WASAPI | ✓ stable | ⚠ session-level | ✓ stable | ~ partial |
The daemon and CLI are thin wrappers. Every capability is reachable through the library crates — embed soundworm directly into your own application.
Start with TOML rules. Graduate to Rhai when you need conditionals, loops, or external lookups — without restarting the daemon.
Install from crates.io or your distro's package manager. The systemd user service starts automatically on login.
Every command works in-process when the daemon is down. Read-only commands (list, metrics) never need a running daemon.
sw list after linking).$XDG_DATA_HOME/soundworm/snapshots/<name>.json.--json for machine-readable output.