weirdnet-audio-stream
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
Publishersends frames of one stream to any number of listeners, in process or over the network.sendnever 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 (
Recordinginto aMemorySource) 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::serveoffers aHubof streams on a weirdnet-net node, asking aStreamAuthabout each subscription;net::Subscriberconnects to one and keepsStats(frames, loss, relative arrival delay, jitter).
The wire format is a length-prefixed message per frame on one weirdnet-net stream (see the wire module).