Skip to main content

Crate sim_lib_stream_audio

Crate sim_lib_stream_audio 

Source
Expand description

PCM source and sink adapters for STREAM 6.

This crate keeps PCM I/O in library space. The in-memory source and sink are deterministic test backends; stream observation still goes through sim-lib-stream-core packets and spines.

Structs§

MemoryPcmSink
In-memory PcmSink that records every written buffer and flush.
MemoryPcmSource
In-memory PcmSource that replays a fixed queue of buffers.
PcmBuffer
Owned block of PCM audio: a PcmSpec plus a frame count and the matching interleaved sample data.
PcmFormatDescriptor
Runtime citizen that carries a PcmSpec as a stream/PcmFormat object.
PcmPumpSummary
Tally of how much audio moved through a pump or stream-adapter run.
PcmSpec
Audio format description for a PCM stream: channel count, sample rate, and sample encoding.

Enums§

PcmSampleFormat
Sample encoding of a PcmPacket.

Traits§

PcmSink
Push sink for PCM audio buffers in a fixed PcmSpec.
PcmSource
Pull source of PCM audio buffers in a fixed PcmSpec.

Functions§

f32_interleaved_to_planar
Splits interleaved f32 samples into one Vec per channel.
f32_planar_to_interleaved
Interleaves per-channel f32 planes into a single interleaved Vec.
f32_sample_to_i16
Converts one normalized f32 sample to i16, clamping to [-1.0, 1.0].
f32_samples_to_i16
Converts a slice of normalized f32 samples to i16 via f32_sample_to_i16.
i16_interleaved_to_planar
Splits interleaved i16 samples into one Vec per channel.
i16_planar_to_interleaved
Interleaves per-channel i16 planes into a single interleaved Vec.
i16_sample_to_f32
Converts one i16 sample to the normalized f32 range [-1.0, 1.0].
i16_samples_to_f32
Converts a slice of i16 samples to normalized f32 samples via i16_sample_to_f32.
pcm_format_class_symbol
Returns the stream/PcmFormat class symbol under which PcmFormatDescriptor is registered.
pcm_source_to_stream
Drains a PcmSource into a pull-mode sim-lib-stream-core StreamValue.
pump_pcm
Drains source into sink, then flushes the sink.
stream_to_pcm_sink
Drains a sim-lib-stream-core StreamValue into a PcmSink.