Skip to main content

StreamAligner

Struct StreamAligner 

Source
pub struct StreamAligner { /* private fields */ }
Expand description

Real-time multi-stream aligner and fractional-delay sinc resampler.

Implementations§

Source§

impl StreamAligner

Source

pub fn new( specs: Vec<StreamSpec>, cfg: SyncConfig, ) -> Result<Self, &'static str>

Create a new aligner for specs using cfg.

Source

pub fn stream_count(&self) -> usize

Number of input streams.

Source

pub fn total_channels(&self) -> usize

Total concatenated channels across all streams.

Source

pub fn output_rate(&self) -> f64

Common output sampling rate in Hz.

Source

pub fn lookahead_seconds(&self) -> f64

Lookahead latency in seconds (half_width / min_input_srate).

Source

pub fn push(&mut self, stream_idx: usize, timestamp: f64, values: &[f64])

Push one f64 sample for stream_idx.

Source

pub fn push_f32(&mut self, stream_idx: usize, timestamp: f64, values: &[f32])

Push one f32 sample for stream_idx.

Source

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.

Source

pub fn buffered_samples(&self, stream_idx: usize) -> usize

Number of buffered samples currently held for stream_idx.

Source

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§

Source§

impl Debug for StreamAligner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.