The pieces / weirdnet-audio-route

weirdnet-audio-routenew

The audio routing model: ports with stable ids, a graph of output-to-input connections, validation, permission hooks, latency along paths and records for saving and syncing.

v0.1.0 GitHub crates.io docs.rs weirdnet-audio-route = "0.1.0"

What it is

A model only: no audio moves here. Executors implement Executor: the engine router in one process, and the remote executor of weirdnet-streaming for edges to other nodes.

Key types and modules

  • Ports with stable ids (node/name by convention) that projects save: direction, kind (audio now, control reserved), format (channels, optional sample rate), the latency the port adds with its quality and how it was found, and a flag for device-output taps.
  • A graph of connections from outputs to inputs, with gain and an on switch. Fan-out and fan-in are allowed. connect refuses unknown ports, wrong directions, kind or format mismatches, duplicates and cycles, then asks an optional Gate (permissions, the audio owner’s consent) and keeps its reason.
  • Sinks: a node such as a recorder whose inputs do not feed its outputs, so routing its mix back does not count as a loop.
  • Order and latency: order gives a deterministic processing order; latency_at the latency reaching an input along the slowest enabled path, with executors able to record measured path delays.
  • Records: to_records and from_records save and restore the graph (and sync it, as a host-authoritative list), validated on load.

Usage

[dependencies]
weirdnet-audio-route = "0.1.0"

Where it fits

  • Used by weirdnet-audio-engine, weirdnet-streaming, weirdnet-audio-record.
  • License: BSD-3-Clause.
Version 0.1.0 is on crates.io (docs.rs, repository).