weirdnet-audio-stream 0.1.0

General-purpose audio streaming for Weirdnet: publish and subscribe to live or recorded streams of codec-agnostic frames, many listeners with their own bounded queues, seeking, arrival statistics and per-subscription authorisation.
Documentation

weirdnet-audio-stream

crates.io docs.rs

General-purpose audio streaming for Weirdnet: publish and subscribe to live or recorded streams of codec-agnostic frames, many listeners with their own bounded queues, seeking, arrival statistics and per-subscription authorisation.

Part of Weirdnet by Weird Brains. BSD-3-Clause.

What it does

  • Publish and subscribe: a Publisher sends frames of one stream to any number of listeners, in process or over the network. send never blocks; each listener has its own bounded queue with an overflow policy (drop oldest, skip to the next key frame, or disconnect), so a slow listener never slows the others.
  • Live and recorded: a late live listener starts at the next key frame; a recorded stream (Recording into a MemorySource) plays from the start or from a position, starting at the key frame at or before it.
  • Codec-agnostic: frames carry bytes, a timestamp in ticks of the stream's clock and a key flag; the stream names its codec and decoder parameters. Raw PCM works with no codec (StreamInfo::pcm_f32, Frame::pcm_f32). Streams and frames carry optional opaque app metadata the crate never reads.
  • Over Weirdnet: net::serve offers a Hub of streams on a weirdnet-net node, asking a StreamAuth about each subscription; net::Subscriber connects to one and keeps Stats (frames, loss, relative arrival delay, jitter).
cargo run --example tone

The wire format is a length-prefixed message per frame on one weirdnet-net stream (see the wire module).