Expand description
File-backed source and sink adapters for STREAM 6.
The crate keeps host filesystem access behind explicit stream file
capabilities: reads require fs/read, writes require fs/write, and
compatibility stream.file.* aliases are accepted by the gates. Each read or
write is recorded as a KERNEL 6 filesystem effect. SMF support reuses the
in-tree MIDI file codec; WAV support is limited to canonical little-endian
PCM16 RIFF/WAVE because that is the PCM packet format implemented by the
stream audio layer. Bounded float-to-PCM16 conversion, finite channel
matrices, seeded TPDF/noise-shaped dither, and their clipping reports live
here beside that canonical WAV owner rather than in analysis or devices.
Structs§
- Channel
Matrix - Finite row-major channel mapping applied before sample quantization.
- Pcm16
Conversion - PCM16 samples plus visible mapping, clipping, and quantization evidence.
- PcmConversion
Report - Audit report for one channel-map and PCM16 quantization pass.
- Quantization
Policy - Hard input bound and explicit quantization policy.
- WavStream
- A PCM stream decoded from a WAV file together with its sample format.
Enums§
- Dither
Policy - Dither and error-feedback policy applied in the PCM16 quantizer.
- PcmConversion
Error - Invalid bounded channel mapping or PCM quantization request.
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.
Functions§
- cassette_
expr_ to_ stream - Decodes a cassette expression and replays it as a stream.
- cassette_
to_ stream - Replays a recorded cassette back into a stream.
- convert_
f32_ to_ pcm16 - Maps bounded interleaved
f32PCM and quantizes it to signed PCM16. - convert_
f32_ to_ wav_ bytes - Maps and quantizes bounded interleaved floats through the canonical PCM16 converter, then encodes them through this crate’s WAV owner.
- pcm16_
samples_ to_ wav_ bytes - Encodes already-quantized interleaved samples as canonical PCM16 WAV.
- pcm_
buffers_ to_ wav_ bytes - Encodes PCM buffers into canonical PCM16 WAV bytes.
- read_
smf_ stream - Reads a Standard MIDI File from
pathand opens it as a MIDI stream. - read_
wav_ stream - Reads a canonical PCM16 WAV file from
pathand opens it as a PCM stream. - smf_
bytes_ to_ stream - Parses Standard MIDI File bytes and opens them as a MIDI stream.
- smf_
file_ to_ stream - Opens an already-parsed Standard MIDI File as a MIDI stream.
- stream_
file_ read_ capability - Returns the capability gating filesystem reads (
fs/read). - stream_
file_ write_ capability - Returns the capability gating filesystem writes (
fs/write). - stream_
to_ cassette - Records a stream into a cassette using the given transport profile.
- stream_
to_ cassette_ expr - Records a stream into a cassette and encodes it as an expression.
- stream_
to_ smf_ bytes - Drains a MIDI stream and encodes it as Standard MIDI File bytes.
- stream_
to_ smf_ file - Drains a MIDI stream into a single-track
SmfFilewithtpqresolution. - stream_
to_ wav_ bytes - Drains a PCM stream and encodes it as canonical PCM16 WAV bytes.
- validate_
cassette_ fixture_ path - Validates a cassette against a golden fixture file at
path. - wav_
bytes_ to_ stream - Decodes canonical PCM16 WAV bytes and opens them as a PCM stream.
- write_
smf_ stream - Drains a MIDI stream and writes it to
pathas a Standard MIDI File. - write_
wav_ stream - Drains a PCM stream and writes it to
pathas a canonical PCM16 WAV file.