pub struct StreamAligner { /* private fields */ }Expand description
Real-time multi-stream aligner and fractional-delay sinc resampler.
Implementations§
Source§impl StreamAligner
impl StreamAligner
Sourcepub fn new(
specs: Vec<StreamSpec>,
cfg: SyncConfig,
) -> Result<Self, &'static str>
pub fn new( specs: Vec<StreamSpec>, cfg: SyncConfig, ) -> Result<Self, &'static str>
Create a new aligner for specs using cfg.
Sourcepub fn stream_count(&self) -> usize
pub fn stream_count(&self) -> usize
Number of input streams.
Sourcepub fn total_channels(&self) -> usize
pub fn total_channels(&self) -> usize
Total concatenated channels across all streams.
Sourcepub fn output_rate(&self) -> f64
pub fn output_rate(&self) -> f64
Common output sampling rate in Hz.
Sourcepub fn lookahead_seconds(&self) -> f64
pub fn lookahead_seconds(&self) -> f64
Lookahead latency in seconds (half_width / min_input_srate).
Sourcepub fn push(&mut self, stream_idx: usize, timestamp: f64, values: &[f64])
pub fn push(&mut self, stream_idx: usize, timestamp: f64, values: &[f64])
Push one f64 sample for stream_idx.
Sourcepub fn push_f32(&mut self, stream_idx: usize, timestamp: f64, values: &[f32])
pub fn push_f32(&mut self, stream_idx: usize, timestamp: f64, values: &[f32])
Push one f32 sample for stream_idx.
Sourcepub fn mark_gap(&mut self, stream_idx: usize, start_ts: f64, end_ts: f64)
pub fn mark_gap(&mut self, stream_idx: usize, start_ts: f64, end_ts: f64)
Record an explicit gap interval (start, end) from Inlet::take_gaps.
Sourcepub fn buffered_samples(&self, stream_idx: usize) -> usize
pub fn buffered_samples(&self, stream_idx: usize) -> usize
Number of buffered samples currently held for stream_idx.
Sourcepub fn pull_aligned(
&mut self,
out: &mut Vec<AlignedSample>,
max_samples: usize,
) -> usize
pub fn pull_aligned( &mut self, out: &mut Vec<AlignedSample>, max_samples: usize, ) -> usize
Pull up to max_samples aligned samples onto the common monotonic grid.
Trait Implementations§
Auto Trait Implementations§
impl Forget for StreamAligner
impl Freeze for StreamAligner
impl Move for StreamAligner
impl RefUnwindSafe for StreamAligner
impl Send for StreamAligner
impl Sync for StreamAligner
impl Unpin for StreamAligner
impl UnsafeUnpin for StreamAligner
impl UnwindSafe for StreamAligner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more