pub struct RawSink { /* private fields */ }Expand description
Sink for passing raw interleaved f32 frames from a backend to the core.
Holds a RawProducer internally. push writes without blocking and is RT-safe
(drops data when full). This is the SPSC producer side; call push only from the backend’s
RT callback thread.
Implementations§
Source§impl RawSink
impl RawSink
Sourcepub fn new(
producer: RawProducer,
native_rate: u32,
native_channels: u16,
) -> Self
pub fn new( producer: RawProducer, native_rate: u32, native_channels: u16, ) -> Self
Create a raw-frame sink with the backend native format.
Sourcepub fn push(&mut self, interleaved: &[f32], pts_ns: i64) -> usize
pub fn push(&mut self, interleaved: &[f32], pts_ns: i64) -> usize
Send raw interleaved f32 frames without blocking.
Built-in backends pass a monotonic arrival time as pts_ns, but this method
discards it: the raw ring carries samples only. Device timestamps are not used.
The facade assigns a fresh arrival time at ingest, where timestamp translation
and 20 ms chunking occur.
Never block; increment the internal overflow counter and drop data when full.
push is intended for backend RT callbacks. Custom backends must not allocate, lock, block,
or make system calls along the path that calls push.
Sourcepub fn diagnostics(&self) -> CaptureDiagnostics
pub fn diagnostics(&self) -> CaptureDiagnostics
Clone the rejection handle before entering a realtime callback.
Sourcepub fn native_rate(&self) -> u32
pub fn native_rate(&self) -> u32
Backend native sample rate (Hz).
Sourcepub fn native_channels(&self) -> u16
pub fn native_channels(&self) -> u16
Backend native channel count.
Sourcepub fn overflow_count(&self) -> u64
pub fn overflow_count(&self) -> u64
Cumulative samples dropped because the buffer was full.