AudioFlow
A typed stream of raw PCM audio: an AudioFormat paired with a Flow of ByteArray chunks.
Every emitted chunk is PCM in format: same sample rate, channel count, and sample encoding. Chunk boundaries are arbitrary; consumers must treat the stream as one continuous byte sequence.
The wrapped Flow may be cold or hot. A cold flow re-emits its full sequence on each collector (typical for replayable recordings). A hot flow shares live emissions among concurrent collectors (typical while recording). format always describes the PCM layout of every chunk, regardless of cold or hot behavior.
Functions
Collects this flow and returns an in-memory buffer containing the encoded file bytes for format (WAV, AIFF, or AU).
Collects every chunk from this flow into one contiguous PCM buffer wrapped as an AudioSource with this flow's AudioFlow.format.
Convert an AudioFlow to a different AudioFormat. Pipeline: bytes -> normalized samples -> resample -> channel convert -> bytes
Collects this flow and writes the PCM data to a file at path.