Skip to main content

Crate weirdnet_audio_stream

Crate weirdnet_audio_stream 

Source
Expand description

Deprecated: this crate is now weirdnet-streaming.

Version 0.3.2 only re-exports weirdnet-streaming, whole, so everything built on weirdnet-audio-stream keeps compiling and shares its types with code that uses the new crate. The API is the 0.3 API unchanged (publisher, hub, recorded sources, net, clock, and remote under feature route), plus what weirdnet-streaming adds (transport, stage, align, bus, listen, along, clocked).

To move over, depend on weirdnet-streaming and write weirdnet_streaming where you wrote weirdnet_audio_stream. No further releases are planned here beyond keeping the re-export in step.

Modules§

align
The stream input’s aligner: where each collaborator’s audio plays on your loop.
along
Record-along on the network: your dry stream (your own voices, each frame stamped with its loop position), your last loop as a stamped recorded take, and playing a collaborator’s take or live dry stream aligned to your loop.
bus
The audio side of listen-along, safe on the audio thread: a wrapper around the engine’s render callback that copies the master out into a ring (the tap, read by the network side to stream it) and adds samples from another ring (the mix, filled by a subscription to someone else’s master out). No locks and no allocation in the callback.
clock
How far another node’s clock is from this one’s, and how fast the gap grows.
clocked
A manual sink on its own clock: a thread that calls the render callback once per block at the pace of a device whose clock runs drift_ppm fast (or slow, when negative) against the monotonic clock. Used for instances whose output is none, and in tests to inject drift.
listen
Listen-along: the host streams its master out as raw PCM (32-bit float) over weirdnet-streaming; members of the session subscribe and hear it mixed into their own output. Each frame carries the sender’s wall-clock time (frame metadata, 8 bytes, microseconds since the Unix epoch) so a listener can measure the one-way delay when the clocks agree (same machine, or synced clocks). The take is kept and offered as a recorded stream that can be played from any position.
net
Streams over weirdnet-net: a Hub served on a node, and a Subscriber to one stream.
remote
A remote executor (feature route): the connections of a weirdnet_audio_route graph between this node’s weirdnet_audio_engine router and other nodes.
stage
Stage stream metadata (record-along): what a stream is, and where on the sender’s loop each frame belongs. The stream crate carries both as opaque bytes.
transport
Follow-transport: a headless master starts, stops, moves and paces several instances so they play on one session time.
wire
The wire format: length-prefixed messages on one weirdnet-net stream.

Structs§

AllowAll
Lets everyone subscribe (tests, or a node whose connections are already gated).
BufferPolicy
How much a listener may queue.
CodecId
An opaque codec name, for the decoder; never interpreted here.
Frame
One frame of a stream.
Hub
The streams a node offers: live publishers and recorded sources.
Listener
The receiving side of one in-process subscription. Dropping it leaves the stream.
ListenerInfo
One listener as the publisher sees it.
MemorySource
A recorded stream held in memory.
Publisher
The sending side of one stream. Cheap to clone; clones share the stream.
Recording
Collects a live stream’s frames into a MemorySource.
Stats
What a subscriber has seen: frames, loss, and how late and how unevenly frames arrive.
StreamId
A stream’s id, unique within its publisher’s hub.
StreamInfo
What a stream is.
SubscribeOptions
How to subscribe.

Enums§

Overflow
What happens when a listener’s queue is full.
Start
Where a subscription starts.
StreamError
Why a stream call failed.
StreamEvent
What a listener receives.
StreamKind
Live (frames as they are produced) or recorded (finite, seekable).

Constants§

PCM_F32LE
Raw PCM, 32-bit float, little endian, interleaved.
PCM_S16LE
Raw PCM, signed 16-bit, little endian, interleaved.

Traits§

FrameSource
A recorded stream a server can play to subscribers.
StreamAuth
Decides whether peer may subscribe to stream. A closure works.