pub struct EncoderAudioInput { /* private fields */ }Expand description
Project-rate audio blocks cut into the encoder’s frames at its own rate.
Implementations§
Source§impl EncoderAudioInput
impl EncoderAudioInput
Sourcepub fn new(
project_rate: u32,
encoder_rate: u32,
channels: usize,
frame_size: usize,
) -> Self
pub fn new( project_rate: u32, encoder_rate: u32, channels: usize, frame_size: usize, ) -> Self
Cuts channels planes at project_rate into frame_size-sample frames at encoder_rate.
Sourcepub fn push(
&mut self,
block: &AudioBlock,
) -> Result<Vec<Vec<Vec<f32>>>, EncodeError>
pub fn push( &mut self, block: &AudioBlock, ) -> Result<Vec<Vec<Vec<f32>>>, EncodeError>
Takes the next block, which must start where the last ended, and returns the whole frames it completes.
§Errors
A block of another rate or channel count, of unequal channels, or out of order.
Sourcepub fn finish(&mut self) -> Vec<Vec<Vec<f32>>>
pub fn finish(&mut self) -> Vec<Vec<Vec<f32>>>
Ends the input and returns the remaining frames, the last as long as what is left.
Sourcepub fn received_ticks(&self) -> i64
pub fn received_ticks(&self) -> i64
The input time accepted so far in ticks, reported back as consumed once its frames are encoded.
Auto Trait Implementations§
impl Forget for EncoderAudioInput
impl Freeze for EncoderAudioInput
impl Move for EncoderAudioInput
impl RefUnwindSafe for EncoderAudioInput
impl Send for EncoderAudioInput
impl Sync for EncoderAudioInput
impl Unpin for EncoderAudioInput
impl UnsafeUnpin for EncoderAudioInput
impl UnwindSafe for EncoderAudioInput
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