pub struct SourceTimeline { /* private fields */ }Expand description
Places one source’s decoded audio by timestamp, leaving gaps silent, and resamples it to the target rate.
Implementations§
Source§impl SourceTimeline
impl SourceTimeline
Sourcepub fn new(target_rate: u32, channels: usize, first: Option<i64>) -> Self
pub fn new(target_rate: u32, channels: usize, first: Option<i64>) -> Self
A timeline producing channels planes at target_rate, giving no output before sample
first when set.
Sourcepub const fn peak_held(&self) -> usize
pub const fn peak_held(&self) -> usize
The most source samples per channel held at once so far.
Sourcepub fn expected(&self, rate: u32) -> Option<i64>
pub fn expected(&self, rate: u32) -> Option<i64>
Where a sample at rate continuing the last placed one would sit;
None before any placement.
Sourcepub fn output_at(&self, rate: u32, source: i64) -> i64
pub fn output_at(&self, rate: u32, source: i64) -> i64
The output sample at or after source sample source at rate.
Sourcepub fn place(
&mut self,
rate: u32,
at: i64,
planes: Vec<Vec<f32>>,
) -> Result<(), DecodeError>
pub fn place( &mut self, rate: u32, at: i64, planes: Vec<Vec<f32>>, ) -> Result<(), DecodeError>
Places planes, decoded at rate, from source sample at, which is never before
expected (the caller drops overlaps). at comes from a timestamp that
passed audio_timestamp_in_range.
§Errors
A rate the resampler cannot take, or planes of the wrong shape.
§Panics
Never: a segment exists once the placement starts one.
Auto Trait Implementations§
impl Forget for SourceTimeline
impl Freeze for SourceTimeline
impl Move for SourceTimeline
impl RefUnwindSafe for SourceTimeline
impl Send for SourceTimeline
impl Sync for SourceTimeline
impl Unpin for SourceTimeline
impl UnsafeUnpin for SourceTimeline
impl UnwindSafe for SourceTimeline
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more